[SCM] Debian packaging for XMLTooling-C branch, etch, updated. upstream/1.0-37-g685139e
Ferenc Wagner
wferi at niif.hu
Tue Sep 16 16:06:09 UTC 2008
The following commit has been merged in the etch branch:
commit 5a0ac114a64631332ca0572714b22afa26fbcc50
Author: Ferenc Wagner <wferi at niif.hu>
Date: Tue Sep 16 16:10:19 2008 +0200
Merge branch 'master' into etch
Move the backport changelog to the head.
Conflicts:
debian/changelog
debian/control
diff --git a/Makefile.am b/Makefile.am
index 05bea16..89132b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,18 +21,18 @@ all-local: xmltooling.spec pkginfo
endif
install-data-hook:
- rm -rf $(DESTDIR)/$(datadir)/doc/@PACKAGE@/api
- cp -r doc/api $(DESTDIR)/$(datadir)/doc/@PACKAGE@
+ rm -rf $(DESTDIR)$(datadir)/doc/@PACKAGE@/api
+ cp -r doc/api $(DESTDIR)$(datadir)/doc/@PACKAGE@
xmltooling.spec: xmltooling.spec.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
pkginfo: pkginfo.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
diff --git a/Makefile.in b/Makefile.in
index d375658..a10e90e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -815,18 +815,18 @@ dist-hook:
@DX_COND_doc_FALSE at all-local: xmltooling.spec pkginfo
install-data-hook:
- rm -rf $(DESTDIR)/$(datadir)/doc/@PACKAGE@/api
- cp -r doc/api $(DESTDIR)/$(datadir)/doc/@PACKAGE@
+ rm -rf $(DESTDIR)$(datadir)/doc/@PACKAGE@/api
+ cp -r doc/api $(DESTDIR)$(datadir)/doc/@PACKAGE@
xmltooling.spec: xmltooling.spec.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
pkginfo: pkginfo.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/config.h.in b/config.h.in
index b726fa6..cd91c9e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -96,6 +96,9 @@
your system. */
#undef PTHREAD_CREATE_JOINABLE
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff --git a/configure b/configure
index 1b6e2a1..e88aa56 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for xmltooling 1.0.
+# Generated by GNU Autoconf 2.59 for xmltooling 1.1.
#
# Report bugs to <mace-opensaml-users at internet2.edu>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xmltooling'
PACKAGE_TARNAME='xmltooling'
-PACKAGE_VERSION='1.0'
-PACKAGE_STRING='xmltooling 1.0'
+PACKAGE_VERSION='1.1'
+PACKAGE_STRING='xmltooling 1.1'
PACKAGE_BUGREPORT='mace-opensaml-users at internet2.edu'
# Factoring default headers for most tests.
@@ -957,7 +957,7 @@ 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 xmltooling 1.0 to adapt to many kinds of systems.
+\`configure' configures xmltooling 1.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1023,7 +1023,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xmltooling 1.0:";;
+ short | recursive ) echo "Configuration of xmltooling 1.1:";;
esac
cat <<\_ACEOF
@@ -1183,7 +1183,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-xmltooling configure 1.0
+xmltooling configure 1.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1197,7 +1197,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xmltooling $as_me 1.0, which was
+It was created by xmltooling $as_me 1.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1844,7 +1844,7 @@ fi
# Define the identity of the package.
PACKAGE=xmltooling
- VERSION=1.0
+ VERSION=1.1
cat >>confdefs.h <<_ACEOF
@@ -21277,6 +21277,420 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+ return 0;
+if (sizeof (long))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$ac_cv_type_long" = yes; then
+ # The cast to unsigned long 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.
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ exit (1);
+ if (((long) (sizeof (long))) < 0)
+ {
+ long i = longval ();
+ if (i != ((long) (sizeof (long))))
+ exit (1);
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long i = ulongval ();
+ if (i != ((long) (sizeof (long))))
+ exit (1);
+ fprintf (f, "%lu\n", i);
+ }
+ exit (ferror (f) || fclose (f) != 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+ ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
# Checks for library functions.
@@ -24938,7 +25352,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by xmltooling $as_me 1.0, which was
+This file was extended by xmltooling $as_me 1.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -25001,7 +25415,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-xmltooling config.status 1.0
+xmltooling config.status 1.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index a2683a7..2edc85e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
AC_PREREQ([2.50])
-AC_INIT([xmltooling], [1.0], [mace-opensaml-users at internet2.edu], [xmltooling])
+AC_INIT([xmltooling], [1.1], [mace-opensaml-users at internet2.edu], [xmltooling])
AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(xmltooling/config_pub.h)
-AM_INIT_AUTOMAKE([xmltooling], [1.0])
+AM_INIT_AUTOMAKE([xmltooling], [1.1])
sinclude(doxygen.m4)
sinclude(acx_pthread.m4)
@@ -61,6 +61,7 @@ AC_PROG_LIBTOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF([long])
# Checks for library functions.
AC_CHECK_FUNCS([strchr strdup strstr timegm strcasecmp])
diff --git a/cpp-xmltooling.sln b/cpp-xmltooling.sln
index 6e59462..f980d37 100644
--- a/cpp-xmltooling.sln
+++ b/cpp-xmltooling.sln
@@ -25,21 +25,35 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Debug|Win32.ActiveCfg = Debug|Win32
{06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Debug|Win32.Build.0 = Debug|Win32
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Debug|x64.ActiveCfg = Debug|x64
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Debug|x64.Build.0 = Debug|x64
{06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Release|Win32.ActiveCfg = Release|Win32
{06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Release|Win32.Build.0 = Release|Win32
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Release|x64.ActiveCfg = Release|x64
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010D}.Release|x64.Build.0 = Release|x64
{3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Debug|Win32.ActiveCfg = Debug|Win32
{3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Debug|Win32.Build.0 = Debug|Win32
+ {3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Debug|x64.ActiveCfg = Debug|x64
+ {3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Debug|x64.Build.0 = Debug|x64
{3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Release|Win32.ActiveCfg = Release|Win32
{3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Release|Win32.Build.0 = Release|Win32
+ {3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Release|x64.ActiveCfg = Release|x64
+ {3E34CDCC-FCBA-490D-A165-1CB6F4559799}.Release|x64.Build.0 = Release|x64
{06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Debug|Win32.ActiveCfg = Debug|Win32
{06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Debug|Win32.Build.0 = Debug|Win32
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Debug|x64.ActiveCfg = Debug|x64
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Debug|x64.Build.0 = Debug|x64
{06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Release|Win32.ActiveCfg = Release|Win32
{06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Release|Win32.Build.0 = Release|Win32
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Release|x64.ActiveCfg = Release|x64
+ {06B55A46-D3B3-41AE-B5A5-B57830BA010E}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/debian/changelog b/debian/changelog
index 01879ce..2de933e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,42 @@
-xmltooling (1.0-1~bpo40+1) etch-backports; urgency=low
+xmltooling (1.1-1~bpo40+1) etch-backports; urgency=low
* Rebuild for etch-backports.
* Build-depend on libxerces27-dev instead of libxerces-c2-dev.
-- Ferenc Wagner <wferi at niif.hu> Fri, 06 Jun 2008 17:54:42 +0200
+xmltooling (1.1-1) UNRELEASED; urgency=low
+
+ [ Russ Allbery ]
+ * New upstream bug-fix release.
+ * Bump SONAME of libxmltooling following upstream's versioning.
+
+ [ Ferenc Wagner ]
+ * Fix watch file for upstream directory structure.
+
+ -- Ferenc Wagner <wferi at niif.hu> Fri, 22 Aug 2008 15:03:00 +0200
+
+xmltooling (1.0-2) unstable; urgency=low
+
+ [ Ferenc Wagner ]
+ * Add dependencies to libxmltooling-dev for the packages whose header
+ files are included by XMLTooling headers.
+ * Include NOTICE.txt in all packages.
+
+ [ Russ Allbery ]
+ * Explicitly link with -lpthread to work around Bug#468555 in libtool.
+ * Change package priorities to extra. Xerces-C is extra, so all of the
+ Shibboleth stack needs to be extra, and realistically it's somewhat of
+ an edge package in Debian.
+ * Add in copyright and license information for all of the other random
+ files in the tree, including all the Autoconf support files.
+ * Fix copyright file formatting to use the right syntax for Files.
+
+ -- Russ Allbery <rra at debian.org> Wed, 18 Jun 2008 20:18:21 -0700
+
xmltooling (1.0-1) unstable; urgency=low
[ Ferenc Wagner ]
* Initial release (Closes: #480287)
- -- Russ Allbery <rra at debian.org> Mon, 26 May 2008 12:41:22 -0700
+ -- Russ Allbery <rra at debian.org> Sat, 07 Jun 2008 13:00:13 -0700
diff --git a/debian/control b/debian/control
index 77860a0..74c8bff 100644
--- a/debian/control
+++ b/debian/control
@@ -1,17 +1,17 @@
Source: xmltooling
Section: libs
-Priority: optional
+Priority: extra
Maintainer: Debian Shib Team <pkg-shibboleth-devel at lists.alioth.debian.org>
Uploaders: Russ Allbery <rra at debian.org>, Ferenc Wagner <wferi at niif.hu>
Build-Depends: debhelper (>= 5), autotools-dev, doxygen,
libcurl3-openssl-dev, liblog4cpp5-dev, libxerces27-dev,
libxml-security-c-dev (>= 1.4)
-Standards-Version: 3.7.3
+Standards-Version: 3.8.0
Homepage: https://spaces.internet2.edu/display/OpenSAML/XMLTooling-C
Vcs-Git: git://git.debian.org/git/pkg-shibboleth/xmltooling.git
Vcs-Browser: http://git.debian.org/?p=pkg-shibboleth/xmltooling.git
-Package: libxmltooling1
+Package: libxmltooling2
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -27,7 +27,8 @@ Description: C++ XML parsing library with encryption support (runtime)
Package: libxmltooling-dev
Section: libdevel
Architecture: any
-Depends: libxmltooling1 (= ${binary:Version})
+Depends: libxmltooling2 (= ${binary:Version}), libcurl4-openssl-dev,
+ liblog4cpp5-dev, libxerces-c2-dev, libxml-security-c-dev (>= 1.4)
Suggests: libxmltooling-doc (= ${source:Version})
Description: C++ XML parsing library with encryption support (development)
The XMLTooling library contains generic XML parsing and processing
diff --git a/debian/copyright b/debian/copyright
index 0d5b131..9635d5f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,236 +1,216 @@
-This package was debianized by Ferenc Wágner <wferi at niif.hu> on
-Mon, 28 Apr 2008 14:55:31 +0200.
-
-It was downloaded from
-
- http://shibboleth.internet2.edu/downloads/opensaml/cpp/2.0/
-
-Upstream Author: Scott Cantor <cantor.2 at osu.edu>
-
-Debian packaging copyright: 2008 Ferenc Wágner <wferi at niif.hu>
- 2008 Russ Allbery <rra at debian.org>
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
+Upstream-Author: Internet2
+Packaged-By: Ferenc Wágner <wferi at niif.hu>
+Packaged-Date: Mon, 28 Apr 2008 14:55:31 +0200
+Original-Source-Location:
+ http://shibboleth.internet2.edu/downloads/opensaml/cpp/2.0/
+
+Files: *
Copyright: 2001-2007 Internet2
+License: Apache-2.0
-License: Apache 2.0
-
- 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.
+Files: */Makefile.in
+Copyright: 2001-2007 Internet2
+ 2004 Oren Ben-Kiki
+ 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+License: other
+ 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.
+
+Files: ./aclocal.m4
+Copyright: 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
+License: other
+ 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.
+
+Files: ./acx_pthread.m4
+Copyright: 2006 Steven G. Johnson <stevenj at alum.mit.edu>
+License: GPL-2+ | other
+ This program 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 the License, or (at your
+ option) any later version.
+ .
+ This program 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.
+ .
+ The full text of the GNU General Public License version 2 is available on
+ Debian systems in /usr/share/common-licenses/GPL-2.
+ .
+ As a special exception, the respective Autoconf Macro's copyright owner
+ gives unlimited permission to copy, distribute and modify the configure
+ scripts that are the output of Autoconf when processing the Macro. You
+ need not follow the terms of the GNU General Public License when using or
+ distributing such scripts, even though portions of the text of the Macro
+ appear in them. The GNU General Public License (GPL) does govern all
+ other use of the material that constitutes the Autoconf Macro.
+ .
+ This special exception to the GPL applies to versions of the Autoconf
+ Macro released by the Autoconf Macro Archive. When you make and
+ distribute a modified version of the Autoconf Macro, you may extend this
+ special exception to the GPL to apply to your modified version as well.
+
+Files: ./config.guess, ./config.sub, ./depcomp, ./libtool.m4, ./ltmain.sh
+ ./missing
+Copyright: 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+License: GPL-2+ | other
+ This file 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 the License, or (at your
+ option) any later version.
+ .
+ This program 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.
+ .
+ The full text of the GNU General Public License version 2 is available on
+ Debian systems in /usr/share/common-licenses/GPL-2.
+ .
+ As a special exception to the GNU General Public License, if you
+ distribute this file as part of a program that contains a configuration
+ script generated by Autoconf, you may include it under the same
+ distribution terms that you use for the rest of that program.
+
+Files: ./configure
+Copyright: 2003 Free Software Foundation, Inc.
+License: other
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+
+Files: ./debian/*
+Copyright: 2008 Ferenc Wágner <wferi at niif.hu>
+ 2008 Russ Allbery <rra at debian.org>
+License: Expat
+
+Files: ./doxygen.{am,m4}
+Copyright: 2004 Oren Ben-Kiki
+License: other
+ 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.
+
+Files: ./install-sh
+Copyright: (C) 1994 X Consortium
+License: Expat
+
+Files: ./schemas/soap-envelope.xsd
+Copyright: 2001 Martin Gudgin, Developmentor
+ 2001 W3C (Massachusetts Institute of Technology, Institut National de
+ Recherche en Informatique et en Automatique, Keio University) All Rights
+ Reserved. http://www.w3.org/Consortium/Legal/
+License: W3C-Software
+
+Files: ./schemas/xml.xsd, ./schemas/xmldsig-core-schema.xsd
+Copyright: 2001 W3C (Massachusetts Institute of Technology, Institut
+ National de Recherche en Informatique et en Automatique, Keio University)
+ All Rights Reserved. http://www.w3.org/Consortium/Legal/
+License: W3C-Software
+
+Files: ./xmltooling/security/*X509CRL.h,
+ ./xmltooling/security/impl/*X509CRL.cpp, ./xmltooling/util/Curl*
+Copyright: 1999-2007 The Apache Software Foundation
+License: Apache-2.0
+
+License: Apache-2.0
+ 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.
+ .
+ On Debian systems, the complete text of the Apache 2.0 license can be
+ found in the file /usr/share/common-licenses/Apache-2.0.
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+License: W3C-Software
+ This W3C work (including software, documents, or other related items) is
+ being provided by the copyright holders under the following license. By
+ obtaining, using and/or copying this work, you (the licensee) agree that
+ you have read, understood, and will comply with the following terms and
+ conditions:
+ .
+ Permission to use, copy, modify, and distribute this software and its
+ documentation, with or without modification, for any purpose and without
+ fee or royalty is hereby granted, provided that you include the following
+ on ALL copies of the software and documentation or portions thereof,
+ including modifications, that you make:
+ .
+ 1. The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.
+ .
+ 2. Any pre-existing intellectual property disclaimers, notices, or terms
+ and conditions. If none exist, a short notice of the following form
+ (hypertext is preferred, text is permitted) should be used within the
+ body of any redistributed or derivative code: "Copyright ©
+ [$date-of-software] World Wide Web Consortium, (Massachusetts
+ Institute of Technology, Institut National de Recherche en
+ Informatique et en Automatique, Keio University). All Rights Reserved.
+ http://www.w3.org/Consortium/Legal/"
+ .
+ 3. Notice of any changes or modifications to the W3C files, including the
+ date changes were made. (We recommend you provide URIs to the location
+ from which the code is derived.)
+ .
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
+ HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
+ DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
+ TRADEMARKS OR OTHER RIGHTS.
+ .
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+ DOCUMENTATION.
+ .
+ The name and trademarks of copyright holders may NOT be used in
+ advertising or publicity pertaining to the software without specific,
+ written prior permission. Title to copyright in this software and any
+ associated documentation will at all times remain with copyright holders.
diff --git a/debian/libxmltooling1.install b/debian/libxmltooling1.install
deleted file mode 100644
index 0d401aa..0000000
--- a/debian/libxmltooling1.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/tmp/usr/lib/lib*.so.*
-debian/overrides/libxmltooling1 usr/share/lintian/overrides
diff --git a/debian/libxmltooling2.install b/debian/libxmltooling2.install
new file mode 100644
index 0000000..c45ebcf
--- /dev/null
+++ b/debian/libxmltooling2.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/lib*.so.*
diff --git a/debian/overrides/libxmltooling1 b/debian/overrides/libxmltooling1
deleted file mode 100644
index 6782423..0000000
--- a/debian/overrides/libxmltooling1
+++ /dev/null
@@ -1 +0,0 @@
-libxmltooling1: several-sonames-in-same-package libxmltooling-lite.so.1 libxmltooling.so.1
diff --git a/debian/rules b/debian/rules
index bd72447..d7e112f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,7 +36,7 @@ configure-stamp:
dh_testdir
cp /usr/share/misc/config.guess config.guess
cp /usr/share/misc/config.sub config.sub
- CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
+ CFLAGS="$(CFLAGS)" LIBS=-lpthread ./configure --prefix=/usr \
--disable-dependency-tracking $(SYSTEM) $(DEBUG)
touch $@
@@ -71,7 +71,7 @@ binary-arch: install-stamp
dh_testdir
dh_testroot
dh_installchangelogs
- dh_installdocs
+ dh_installdocs -A doc/NOTICE.txt
dh_link
dh_strip
dh_compress
@@ -88,7 +88,7 @@ binary-indep: install-stamp
dh_testdir
dh_testroot
dh_installchangelogs
- dh_installdocs
+ dh_installdocs -A doc/NOTICE.txt
dh_link
dh_compress
dh_fixperms
diff --git a/debian/watch b/debian/watch
index 9b3740c..24347e3 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,2 @@
version=3
-http://shibboleth.internet2.edu/downloads/opensaml/cpp/2.0/xmltooling-(.*)\.tar\.gz
+http://shibboleth.internet2.edu/downloads/opensaml/cpp/latest/xmltooling-(.*)\.tar\.gz
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 06ac078..25d6f2d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -3,6 +3,7 @@ AUTOMAKE_OPTIONS = foreign
pkgdocdir = $(datadir)/doc/@PACKAGE@
docfiles = \
+ README.txt \
LICENSE.txt \
NOTICE.txt \
OPENSSL.LICENSE \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 33066b4..a90d024 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -231,6 +231,7 @@ target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
pkgdocdir = $(datadir)/doc/@PACKAGE@
docfiles = \
+ README.txt \
LICENSE.txt \
NOTICE.txt \
OPENSSL.LICENSE \
diff --git a/doc/README.txt b/doc/README.txt
new file mode 100644
index 0000000..1f9cd13
--- /dev/null
+++ b/doc/README.txt
@@ -0,0 +1,20 @@
+VERSION 1.1
+
+Issues addressed by this release:
+---------------------------------
+https://bugs.internet2.edu/jira/secure/IssueNavigator.jspa?reset=true&&pid=10009&fixfor=10134&status=5&status=6&sorter/field=issuekey&sorter/order=ASC
+
+Documentation:
+--------------
+The OpenSAML wiki is the home for any documentation on the XMLTooling package.
+https://spaces.internet2.edu/display/OpenSAML/
+
+Reporting Bugs:
+---------------
+A Jira instance is available.
+https://bugs.internet2.edu/
+
+Support:
+--------
+A mailing list is available.
+https://spaces.internet2.edu/display/OpenSAML/MailingList
diff --git a/pkginfo b/pkginfo
index 27bd3f0..3b210ae 100644
--- a/pkginfo
+++ b/pkginfo
@@ -1,5 +1,5 @@
PKG=SHIBxmltool
-VERSION=1.0
+VERSION=1.1
NAME=xmltooling-c
CATEGORY=application,textproc,security
DESC=Library for DOM processing with Signature/Encryption for C++
diff --git a/xmltooling.spec b/xmltooling.spec
index 3127419..75abc36 100644
--- a/xmltooling.spec
+++ b/xmltooling.spec
@@ -1,7 +1,7 @@
Name: xmltooling
Summary: Open source XMLTooling library
-Version: 1.0
-Release: 6
+Version: 1.1
+Release: 1
Group: System Environment/Libraries
Vendor: Internet2
License: Apache 2.0
@@ -80,6 +80,7 @@ find $RPM_BUILD_ROOT/%{_bindir} -type f |
%dir %{_datadir}/xml/xmltooling
%{_datadir}/xml/xmltooling
%docdir %{_datadir}/doc/xmltooling
+%{_datadir}/doc/xmltooling/README.txt
%{_datadir}/doc/xmltooling/LICENSE.txt
%{_datadir}/doc/xmltooling/NOTICE.txt
%{_datadir}/doc/xmltooling/CURL.LICENSE
@@ -97,6 +98,9 @@ find $RPM_BUILD_ROOT/%{_bindir} -type f |
%doc %{_datadir}/doc/xmltooling/api
%changelog
+* Tue Jul 1 2008 Scott Cantor <cantor.2 at osu.edu> - 1.1-1
+- Bumping for minor update.
+
* Mon Mar 17 2008 Scott Cantor <cantor.2 at osu.edu> - 1.0-6
- Official release.
diff --git a/xmltooling.spec.in b/xmltooling.spec.in
index 8cac0f4..3537821 100644
--- a/xmltooling.spec.in
+++ b/xmltooling.spec.in
@@ -1,7 +1,7 @@
Name: xmltooling
Summary: Open source XMLTooling library
Version: @-VERSION-@
-Release: 6
+Release: 1
Group: System Environment/Libraries
Vendor: Internet2
License: Apache 2.0
@@ -80,6 +80,7 @@ find $RPM_BUILD_ROOT/%{_bindir} -type f |
%dir %{_datadir}/xml/xmltooling
%{_datadir}/xml/xmltooling
%docdir %{_datadir}/doc/xmltooling
+%{_datadir}/doc/xmltooling/README.txt
%{_datadir}/doc/xmltooling/LICENSE.txt
%{_datadir}/doc/xmltooling/NOTICE.txt
%{_datadir}/doc/xmltooling/CURL.LICENSE
@@ -97,6 +98,9 @@ find $RPM_BUILD_ROOT/%{_bindir} -type f |
%doc %{_datadir}/doc/xmltooling/api
%changelog
+* Tue Jul 1 2008 Scott Cantor <cantor.2 at osu.edu> - 1.1-1
+- Bumping for minor update.
+
* Mon Mar 17 2008 Scott Cantor <cantor.2 at osu.edu> - 1.0-6
- Official release.
diff --git a/xmltooling/AbstractXMLObject.cpp b/xmltooling/AbstractXMLObject.cpp
index 6448856..a8461a4 100644
--- a/xmltooling/AbstractXMLObject.cpp
+++ b/xmltooling/AbstractXMLObject.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,7 +16,7 @@
/**
* AbstractXMLObject.cpp
- *
+ *
* An abstract implementation of XMLObject.
*/
@@ -49,6 +49,13 @@ AbstractXMLObject::AbstractXMLObject(const AbstractXMLObject& src)
m_typeQname=new QName(*src.m_typeQname);
}
+AbstractXMLObject::~AbstractXMLObject()
+{
+ delete m_typeQname;
+ xercesc::XMLString::release(&m_schemaLocation);
+ xercesc::XMLString::release(&m_noNamespaceSchemaLocation);
+}
+
void XMLObject::setNil(const XMLCh* value) {
if (value) {
switch (*value) {
@@ -121,21 +128,27 @@ DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const Date
return newValue ? new DateTime(*newValue) : NULL;
}
-DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, time_t newValue)
+DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration)
{
delete oldValue;
releaseThisandParentDOM();
DateTime* ret = new DateTime(newValue);
- ret->parseDateTime();
+ if (duration)
+ ret->parseDuration();
+ else
+ ret->parseDateTime();
return ret;
}
-DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const XMLCh* newValue)
+DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const XMLCh* newValue, bool duration)
{
delete oldValue;
releaseThisandParentDOM();
DateTime* ret = new DateTime(newValue);
- ret->parseDateTime();
+ if (duration)
+ ret->parseDuration();
+ else
+ ret->parseDateTime();
return ret;
}
diff --git a/xmltooling/AbstractXMLObject.h b/xmltooling/AbstractXMLObject.h
index 7767167..fc4c23b 100644
--- a/xmltooling/AbstractXMLObject.h
+++ b/xmltooling/AbstractXMLObject.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,7 +16,7 @@
/**
* @file xmltooling/AbstractXMLObject.h
- *
+ *
* An abstract implementation of XMLObject.
*/
@@ -44,11 +44,7 @@ namespace xmltooling {
class XMLTOOL_API AbstractXMLObject : public virtual XMLObject
{
public:
- virtual ~AbstractXMLObject() {
- delete m_typeQname;
- xercesc::XMLString::release(&m_schemaLocation);
- xercesc::XMLString::release(&m_noNamespaceSchemaLocation);
- }
+ virtual ~AbstractXMLObject();
void detach();
@@ -59,7 +55,7 @@ namespace xmltooling {
const std::set<Namespace>& getNamespaces() const {
return m_namespaces;
}
-
+
void addNamespace(const Namespace& ns) const {
std::set<Namespace>::iterator i = m_namespaces.find(ns);
if (i == m_namespaces.end())
@@ -67,23 +63,23 @@ namespace xmltooling {
else if (ns.alwaysDeclare())
const_cast<Namespace&>(*i).setAlwaysDeclare(true);
}
-
+
void removeNamespace(const Namespace& ns) {
m_namespaces.erase(ns);
}
-
+
const QName* getSchemaType() const {
return m_typeQname;
}
-
+
const XMLCh* getXMLID() const {
return NULL;
}
-
+
xmlconstants::xmltooling_bool_t getNil() const {
return m_nil;
}
-
+
void nil(xmlconstants::xmltooling_bool_t value) {
if (m_nil != value) {
releaseThisandParentDOM();
@@ -94,11 +90,11 @@ namespace xmltooling {
bool hasParent() const {
return m_parent != NULL;
}
-
+
XMLObject* getParent() const {
return m_parent;
}
-
+
void setParent(XMLObject* parent) {
m_parent = parent;
}
@@ -106,7 +102,7 @@ namespace xmltooling {
protected:
/**
* Constructor
- *
+ *
* @param nsURI the namespace of the element
* @param localName the local name of the XML element this Object represents
* @param prefix the namespace prefix to use
@@ -118,17 +114,17 @@ namespace xmltooling {
/** Copy constructor. */
AbstractXMLObject(const AbstractXMLObject& src);
-
+
/**
* A helper function for derived classes, for assignment of strings.
*
* This 'normalizes' newString, and then if it is different from oldString,
* it invalidates the DOM, frees the old string, and returns the new.
* If not different, it frees the new string and just returns the old value.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
XMLCh* prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue);
@@ -137,10 +133,10 @@ namespace xmltooling {
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
DateTime* prepareForAssignment(DateTime* oldValue, const DateTime* newValue);
@@ -149,50 +145,52 @@ namespace xmltooling {
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the epoch to assign as the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the epoch to assign as the new value
+ * @param duration true iff the value is a duration rather than an absolute timestamp
+ *
* @return the value that should be assigned
*/
- DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue);
+ DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration=false);
/**
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value in string form
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value in string form
+ * @param duration true iff the value is a duration rather than an absolute timestamp
+ *
* @return the value that should be assigned
*/
- DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue);
+ DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue, bool duration=false);
/**
* A helper function for derived classes, for assignment of QName data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
QName* prepareForAssignment(QName* oldValue, const QName* newValue);
/**
* A helper function for derived classes, for assignment of (singleton) XML objects.
- *
- * It is indifferent to whether either the old or the new version of the value is null.
+ *
+ * It is indifferent to whether either the old or the new version of the value is null.
* This method will do a safe compare of the objects and will also invalidate the DOM if appropriate.
* Note that since the new value (even if NULL) is always returned, it may be more efficient
* to discard the return value and just assign independently if a dynamic cast would be involved.
- *
- * @param oldValue - current value
- * @param newValue - proposed new value
- * @return the new value
- *
+ *
+ * @param oldValue current value
+ * @param newValue proposed new value
+ * @return the new value
+ *
* @throws XMLObjectException if the new child already has a parent.
*/
XMLObject* prepareForAssignment(XMLObject* oldValue, XMLObject* newValue);
@@ -216,7 +214,7 @@ namespace xmltooling {
* Stores off xsi:noNamespaceSchemaLocation attribute.
*/
XMLCh* m_noNamespaceSchemaLocation;
-
+
/**
* Stores off xsi:nil attribute.
*/
diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am
index 1a6cf05..a580e53 100644
--- a/xmltooling/Makefile.am
+++ b/xmltooling/Makefile.am
@@ -195,10 +195,10 @@ common_sources = \
libxmltooling_lite_la_SOURCES = \
${common_sources}
libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
-libxmltooling_lite_la_LDFLAGS = -version-info 1:0:0
+libxmltooling_lite_la_LDFLAGS = -version-info 2:0:0
if BUILD_XMLSEC
-libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
+libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 2:0:0
libxmltooling_la_SOURCES = \
${common_sources} \
${xmlsec_sources}
@@ -207,4 +207,11 @@ endif
install-exec-hook:
for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
-EXTRA_DIST = xmltooling.vcproj xmltooling-lite.vcproj config_pub.h.in config_pub_win32.h resource.h xmltooling.rc
+EXTRA_DIST = \
+ xmltooling.vcproj \
+ xmltooling-lite.vcproj \
+ config_pub.h.in \
+ config_pub_win32.h\
+ resource.h\
+ xmltooling.rc \
+ util/Win32Threads.cpp
diff --git a/xmltooling/Makefile.in b/xmltooling/Makefile.in
index 4e91fe5..f40220a 100644
--- a/xmltooling/Makefile.in
+++ b/xmltooling/Makefile.in
@@ -566,13 +566,21 @@ libxmltooling_lite_la_SOURCES = \
${common_sources}
libxmltooling_lite_la_CPPFLAGS = -DXMLTOOLING_LITE
-libxmltooling_lite_la_LDFLAGS = -version-info 1:0:0
- at BUILD_XMLSEC_TRUE@libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
+libxmltooling_lite_la_LDFLAGS = -version-info 2:0:0
+ at BUILD_XMLSEC_TRUE@libxmltooling_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 2:0:0
@BUILD_XMLSEC_TRUE at libxmltooling_la_SOURCES = \
@BUILD_XMLSEC_TRUE@ ${common_sources} \
@BUILD_XMLSEC_TRUE@ ${xmlsec_sources}
-EXTRA_DIST = xmltooling.vcproj xmltooling-lite.vcproj config_pub.h.in config_pub_win32.h resource.h xmltooling.rc
+EXTRA_DIST = \
+ xmltooling.vcproj \
+ xmltooling-lite.vcproj \
+ config_pub.h.in \
+ config_pub_win32.h\
+ resource.h\
+ xmltooling.rc \
+ util/Win32Threads.cpp
+
all: config_pub.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/xmltooling/XMLObjectBuilder.h b/xmltooling/XMLObjectBuilder.h
index 80fa690..ef54e17 100644
--- a/xmltooling/XMLObjectBuilder.h
+++ b/xmltooling/XMLObjectBuilder.h
@@ -1,206 +1,207 @@
-/*
- * Copyright 2001-2007 Internet2
- *
- * 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.
- */
-
-/**
- * @file xmltooling/XMLObjectBuilder.h
- *
- * Factory interface for XMLObjects.
- */
-
-#ifndef __xmltooling_xmlobjbuilder_h__
-#define __xmltooling_xmlobjbuilder_h__
-
-#include <map>
-#include <xmltooling/QName.h>
-#include <xmltooling/XMLObject.h>
-#include <xmltooling/util/XMLHelper.h>
-
-#if defined (_MSC_VER)
- #pragma warning( push )
- #pragma warning( disable : 4250 4251 )
-#endif
-
-namespace xmltooling {
-
- /**
- * A factory interface for obtaining XMLObjects.
- * Subclasses MAY supply additional factory methods.
- */
- class XMLTOOL_API XMLObjectBuilder
- {
- MAKE_NONCOPYABLE(XMLObjectBuilder);
- public:
- virtual ~XMLObjectBuilder() {}
-
- /**
- * Creates an empty XMLObject with a particular element name.
- * <p>The results are undefined if localName is NULL or empty.
- *
- * @param nsURI namespace URI for element
- * @param localName local name of element
- * @param prefix prefix of element name
- * @param schemaType xsi:type of the object
- * @return the empty XMLObject
- */
- virtual XMLObject* buildObject(
- const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
- ) const=0;
-
- /**
- * Creates an empty XMLObject with a particular element name.
- *
- * @param q QName of element for object
- * @return the empty XMLObject
- */
- XMLObject* buildFromQName(const QName& q) const {
- return buildObject(q.getNamespaceURI(),q.getLocalPart(),q.getPrefix());
- }
-
- /**
- * Creates an unmarshalled XMLObject from a DOM Element.
- *
- * @param element the unmarshalling source
- * @param bindDocument true iff the XMLObject should take ownership of the DOM Document
- * @return the unmarshalled XMLObject
- */
- XMLObject* buildFromElement(xercesc::DOMElement* element, bool bindDocument=false) const {
- std::auto_ptr<XMLObject> ret(
- buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))
- );
- ret->unmarshall(element,bindDocument);
- return ret.release();
- }
-
- /**
- * Creates an unmarshalled XMLObject from the root of a DOM Document.
- *
- * @param doc the unmarshalling source
- * @param bindDocument true iff the XMLObject should take ownership of the DOM Document
- * @return the unmarshalled XMLObject
- */
- XMLObject* buildFromDocument(xercesc::DOMDocument* doc, bool bindDocument=true) const {
- return buildFromElement(doc->getDocumentElement(),bindDocument);
- }
-
- /**
- * Creates an unmarshalled XMLObject using the default build method, if a builder can be found.
- *
- * @param element the unmarshalling source
- * @param bindDocument true iff the new XMLObject should take ownership of the DOM Document
- * @return the unmarshalled object or NULL if no builder is available
- */
- static XMLObject* buildOneFromElement(xercesc::DOMElement* element, bool bindDocument=false) {
- const XMLObjectBuilder* b=getBuilder(element);
- return b ? b->buildFromElement(element,bindDocument) : NULL;
- }
-
- /**
- * Retrieves an XMLObjectBuilder using the key it was registered with.
- *
- * @param key the key used to register the builder
- * @return the builder or NULL
- */
- static const XMLObjectBuilder* getBuilder(const QName& key) {
- std::map<QName,XMLObjectBuilder*>::const_iterator i=m_map.find(key);
- return (i==m_map.end()) ? NULL : i->second;
- }
-
- /**
- * Retrieves an XMLObjectBuilder for a given DOM element.
- * If no match is found, the default builder is returned, if any.
- *
- * @param element the element for which to locate a builder
- * @return the builder or NULL
- */
- static const XMLObjectBuilder* getBuilder(const xercesc::DOMElement* element);
-
- /**
- * Retrieves the default XMLObjectBuilder for DOM elements
- *
- * @return the default builder or NULL
- */
- static const XMLObjectBuilder* getDefaultBuilder() {
- return m_default;
- }
-
- /**
- * Gets an immutable list of all the builders currently registered.
- *
- * @return list of all the builders currently registered
- */
- static const std::map<QName,XMLObjectBuilder*>& getBuilders() {
- return m_map;
- }
-
- /**
- * Registers a new builder for the given key.
- *
- * @param builderKey the key used to retrieve this builder later
- * @param builder the builder
- */
- static void registerBuilder(const QName& builderKey, XMLObjectBuilder* builder) {
- deregisterBuilder(builderKey);
- m_map[builderKey]=builder;
- }
-
- /**
- * Registers a default builder
- *
- * @param builder the default builder
- */
- static void registerDefaultBuilder(XMLObjectBuilder* builder) {
- deregisterDefaultBuilder();
- m_default=builder;
- }
-
- /**
- * Deregisters a builder.
- *
- * @param builderKey the key for the builder to be deregistered
- */
- static void deregisterBuilder(const QName& builderKey) {
- delete getBuilder(builderKey);
- m_map.erase(builderKey);
- }
-
- /**
- * Deregisters default builder.
- */
- static void deregisterDefaultBuilder() {
- delete m_default;
- m_default=NULL;
- }
-
- /**
- * Unregisters and destroys all registered builders.
- */
- static void destroyBuilders();
-
- protected:
- XMLObjectBuilder() {}
-
- private:
- static std::map<QName,XMLObjectBuilder*> m_map;
- static XMLObjectBuilder* m_default;
- };
-
-};
-
-#if defined (_MSC_VER)
- #pragma warning( pop )
-#endif
-
-#endif /* __xmltooling_xmlobjbuilder_h__ */
+/*
+ * Copyright 2001-2007 Internet2
+ *
+ * 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.
+ */
+
+/**
+ * @file xmltooling/XMLObjectBuilder.h
+ *
+ * Factory interface for XMLObjects.
+ */
+
+#ifndef __xmltooling_xmlobjbuilder_h__
+#define __xmltooling_xmlobjbuilder_h__
+
+#include <map>
+#include <memory>
+#include <xmltooling/QName.h>
+#include <xmltooling/XMLObject.h>
+#include <xmltooling/util/XMLHelper.h>
+
+#if defined (_MSC_VER)
+ #pragma warning( push )
+ #pragma warning( disable : 4250 4251 )
+#endif
+
+namespace xmltooling {
+
+ /**
+ * A factory interface for obtaining XMLObjects.
+ * Subclasses MAY supply additional factory methods.
+ */
+ class XMLTOOL_API XMLObjectBuilder
+ {
+ MAKE_NONCOPYABLE(XMLObjectBuilder);
+ public:
+ virtual ~XMLObjectBuilder() {}
+
+ /**
+ * Creates an empty XMLObject with a particular element name.
+ * <p>The results are undefined if localName is NULL or empty.
+ *
+ * @param nsURI namespace URI for element
+ * @param localName local name of element
+ * @param prefix prefix of element name
+ * @param schemaType xsi:type of the object
+ * @return the empty XMLObject
+ */
+ virtual XMLObject* buildObject(
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const QName* schemaType=NULL
+ ) const=0;
+
+ /**
+ * Creates an empty XMLObject with a particular element name.
+ *
+ * @param q QName of element for object
+ * @return the empty XMLObject
+ */
+ XMLObject* buildFromQName(const QName& q) const {
+ return buildObject(q.getNamespaceURI(),q.getLocalPart(),q.getPrefix());
+ }
+
+ /**
+ * Creates an unmarshalled XMLObject from a DOM Element.
+ *
+ * @param element the unmarshalling source
+ * @param bindDocument true iff the XMLObject should take ownership of the DOM Document
+ * @return the unmarshalled XMLObject
+ */
+ XMLObject* buildFromElement(xercesc::DOMElement* element, bool bindDocument=false) const {
+ std::auto_ptr<XMLObject> ret(
+ buildObject(element->getNamespaceURI(),element->getLocalName(),element->getPrefix(),XMLHelper::getXSIType(element))
+ );
+ ret->unmarshall(element,bindDocument);
+ return ret.release();
+ }
+
+ /**
+ * Creates an unmarshalled XMLObject from the root of a DOM Document.
+ *
+ * @param doc the unmarshalling source
+ * @param bindDocument true iff the XMLObject should take ownership of the DOM Document
+ * @return the unmarshalled XMLObject
+ */
+ XMLObject* buildFromDocument(xercesc::DOMDocument* doc, bool bindDocument=true) const {
+ return buildFromElement(doc->getDocumentElement(),bindDocument);
+ }
+
+ /**
+ * Creates an unmarshalled XMLObject using the default build method, if a builder can be found.
+ *
+ * @param element the unmarshalling source
+ * @param bindDocument true iff the new XMLObject should take ownership of the DOM Document
+ * @return the unmarshalled object or NULL if no builder is available
+ */
+ static XMLObject* buildOneFromElement(xercesc::DOMElement* element, bool bindDocument=false) {
+ const XMLObjectBuilder* b=getBuilder(element);
+ return b ? b->buildFromElement(element,bindDocument) : NULL;
+ }
+
+ /**
+ * Retrieves an XMLObjectBuilder using the key it was registered with.
+ *
+ * @param key the key used to register the builder
+ * @return the builder or NULL
+ */
+ static const XMLObjectBuilder* getBuilder(const QName& key) {
+ std::map<QName,XMLObjectBuilder*>::const_iterator i=m_map.find(key);
+ return (i==m_map.end()) ? NULL : i->second;
+ }
+
+ /**
+ * Retrieves an XMLObjectBuilder for a given DOM element.
+ * If no match is found, the default builder is returned, if any.
+ *
+ * @param element the element for which to locate a builder
+ * @return the builder or NULL
+ */
+ static const XMLObjectBuilder* getBuilder(const xercesc::DOMElement* element);
+
+ /**
+ * Retrieves the default XMLObjectBuilder for DOM elements
+ *
+ * @return the default builder or NULL
+ */
+ static const XMLObjectBuilder* getDefaultBuilder() {
+ return m_default;
+ }
+
+ /**
+ * Gets an immutable list of all the builders currently registered.
+ *
+ * @return list of all the builders currently registered
+ */
+ static const std::map<QName,XMLObjectBuilder*>& getBuilders() {
+ return m_map;
+ }
+
+ /**
+ * Registers a new builder for the given key.
+ *
+ * @param builderKey the key used to retrieve this builder later
+ * @param builder the builder
+ */
+ static void registerBuilder(const QName& builderKey, XMLObjectBuilder* builder) {
+ deregisterBuilder(builderKey);
+ m_map[builderKey]=builder;
+ }
+
+ /**
+ * Registers a default builder
+ *
+ * @param builder the default builder
+ */
+ static void registerDefaultBuilder(XMLObjectBuilder* builder) {
+ deregisterDefaultBuilder();
+ m_default=builder;
+ }
+
+ /**
+ * Deregisters a builder.
+ *
+ * @param builderKey the key for the builder to be deregistered
+ */
+ static void deregisterBuilder(const QName& builderKey) {
+ delete getBuilder(builderKey);
+ m_map.erase(builderKey);
+ }
+
+ /**
+ * Deregisters default builder.
+ */
+ static void deregisterDefaultBuilder() {
+ delete m_default;
+ m_default=NULL;
+ }
+
+ /**
+ * Unregisters and destroys all registered builders.
+ */
+ static void destroyBuilders();
+
+ protected:
+ XMLObjectBuilder() {}
+
+ private:
+ static std::map<QName,XMLObjectBuilder*> m_map;
+ static XMLObjectBuilder* m_default;
+ };
+
+};
+
+#if defined (_MSC_VER)
+ #pragma warning( pop )
+#endif
+
+#endif /* __xmltooling_xmlobjbuilder_h__ */
diff --git a/xmltooling/base.h b/xmltooling/base.h
index b6d3ba3..05128dd 100644
--- a/xmltooling/base.h
+++ b/xmltooling/base.h
@@ -1,1576 +1,1597 @@
-/*
- * Copyright 2001-2007 Internet2
- *
- * 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.
- */
-
-/**
- * @file xmltooling/base.h
- *
- * Base header file definitions
- * Must be included prior to including any other header
- */
-
-#ifndef __xmltooling_base_h__
-#define __xmltooling_base_h__
-
-#if defined (_MSC_VER) || defined(__BORLANDC__)
- #include <xmltooling/config_pub_win32.h>
-#else
- #include <xmltooling/config_pub.h>
-#endif
-
-#ifdef XMLTOOLING_LITE
-# define XMLTOOLING_NO_XMLSEC 1
-#endif
-
-// Windows and GCC4 Symbol Visibility Macros
-#ifdef WIN32
- #define XMLTOOL_IMPORT __declspec(dllimport)
- #define XMLTOOL_EXPORT __declspec(dllexport)
- #define XMLTOOL_DLLLOCAL
- #define XMLTOOL_DLLPUBLIC
-#else
- #define XMLTOOL_IMPORT
- #ifdef GCC_HASCLASSVISIBILITY
- #define XMLTOOL_EXPORT __attribute__ ((visibility("default")))
- #define XMLTOOL_DLLLOCAL __attribute__ ((visibility("hidden")))
- #define XMLTOOL_DLLPUBLIC __attribute__ ((visibility("default")))
- #else
- #define XMLTOOL_EXPORT
- #define XMLTOOL_DLLLOCAL
- #define XMLTOOL_DLLPUBLIC
- #endif
-#endif
-
-// Define XMLTOOL_API for DLL builds
-#ifdef XMLTOOLING_EXPORTS
- #define XMLTOOL_API XMLTOOL_EXPORT
-#else
- #define XMLTOOL_API XMLTOOL_IMPORT
-#endif
-
-// Throwable classes must always be visible on GCC in all binaries
-#ifdef WIN32
- #define XMLTOOL_EXCEPTIONAPI(api) api
-#elif defined(GCC_HASCLASSVISIBILITY)
- #define XMLTOOL_EXCEPTIONAPI(api) XMLTOOL_EXPORT
-#else
- #define XMLTOOL_EXCEPTIONAPI(api)
-#endif
-
-#ifdef _MSC_VER
- #define XMLTOOLING_DOXYGEN(desc) /##** desc */
-#else
- #define XMLTOOLING_DOXYGEN(desc)
-#endif
-
-/**
- * Blocks copy c'tor and assignment operator for a class.
- */
-#define MAKE_NONCOPYABLE(type) \
- private: \
- type(const type&); \
- type& operator=(const type&)
-
-#ifndef DOXYGEN_SKIP
-#ifndef NULL
-#define NULL 0
-#endif
-#define UNICODE_LITERAL_1(a) {xercesc::chLatin_##a, xercesc::chNull}
-#define UNICODE_LITERAL_2(a,b) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chNull}
-#define UNICODE_LITERAL_3(a,b,c) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chNull}
-#define UNICODE_LITERAL_4(a,b,c,d) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chNull}
-#define UNICODE_LITERAL_5(a,b,c,d,e) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chNull}
-#define UNICODE_LITERAL_6(a,b,c,d,e,f) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chNull}
-#define UNICODE_LITERAL_7(a,b,c,d,e,f,g) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chNull}
-#define UNICODE_LITERAL_8(a,b,c,d,e,f,g,h) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chNull}
-#define UNICODE_LITERAL_9(a,b,c,d,e,f,g,h,i) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, xercesc::chNull}
-#define UNICODE_LITERAL_10(a,b,c,d,e,f,g,h,i,j) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chNull}
-#define UNICODE_LITERAL_11(a,b,c,d,e,f,g,h,i,j,k) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chNull}
-#define UNICODE_LITERAL_12(a,b,c,d,e,f,g,h,i,j,k,l) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chNull}
-#define UNICODE_LITERAL_13(a,b,c,d,e,f,g,h,i,j,k,l,m) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chNull}
-#define UNICODE_LITERAL_14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chNull}
-#define UNICODE_LITERAL_15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chNull}
-#define UNICODE_LITERAL_16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chNull}
-#define UNICODE_LITERAL_17(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chNull}
-#define UNICODE_LITERAL_18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, xercesc::chNull}
-#define UNICODE_LITERAL_19(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chNull}
-#define UNICODE_LITERAL_20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chNull}
-#define UNICODE_LITERAL_21(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chNull}
-#define UNICODE_LITERAL_22(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chNull}
-#define UNICODE_LITERAL_23(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chNull}
-#define UNICODE_LITERAL_24(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chNull}
-#define UNICODE_LITERAL_25(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chNull}
-#define UNICODE_LITERAL_26(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, xercesc::chNull}
-#define UNICODE_LITERAL_27(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chNull}
-#define UNICODE_LITERAL_28(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chNull}
-#define UNICODE_LITERAL_29(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chNull}
-#define UNICODE_LITERAL_30(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chNull}
-#define UNICODE_LITERAL_31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chNull}
-#define UNICODE_LITERAL_32(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chNull}
-#define UNICODE_LITERAL_33(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chLatin_##gg, xercesc::chNull}
-#define UNICODE_LITERAL_34(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg,hh) \
- {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
- xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
- xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
- xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chLatin_##gg, xercesc::chLatin_##hh, xercesc::chNull}
-#endif /* DOXYGEN_SKIP */
-
-/**
- * Begins the declaration of an XMLObject specialization for an abstract element/type.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define DECL_XMLOBJECT_ABSTRACT(linkage,cname,base,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]; \
- }
-
-/**
- * Begins the declaration of an XMLObject specialization.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define BEGIN_XMLOBJECT(linkage,cname,base,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Type-specific clone method.) \
- virtual cname* clone##cname() const=0; \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]
-
-/**
- * Begins the declaration of an XMLObject specialization with two base classes.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the first base class to derive from using public virtual inheritance
- * @param base2 the second base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define BEGIN_XMLOBJECT2(linkage,cname,base,base2,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base, public virtual base2 { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Type-specific clone method.) \
- virtual cname* clone##cname() const=0; \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]
-
-/**
- * Begins the declaration of an XMLObject specialization with three base classes.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the first base class to derive from using public virtual inheritance
- * @param base2 the second base class to derive from using public virtual inheritance
- * @param base3 the third base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define BEGIN_XMLOBJECT3(linkage,cname,base,base2,base3,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base, public virtual base2, public virtual base3 { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Type-specific clone method.) \
- virtual cname* clone##cname() const=0; \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]
-
-/**
- * Begins the declaration of an XMLObject specialization with four base classes.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the first base class to derive from using public virtual inheritance
- * @param base2 the second base class to derive from using public virtual inheritance
- * @param base3 the third base class to derive from using public virtual inheritance
- * @param base4 the fourth base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define BEGIN_XMLOBJECT4(linkage,cname,base,base2,base3,base4,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base, public virtual base2, public virtual base3, public virtual base4 { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Type-specific clone method.) \
- virtual cname* clone##cname() const=0; \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]
-
-/**
- * Begins the declaration of an XMLObject specialization with five base classes.
- * Basic boilerplate includes a protected constructor, empty virtual destructor,
- * and Unicode constants for the default associated element's name and prefix.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the class to declare
- * @param base the first base class to derive from using public virtual inheritance
- * @param base2 the second base class to derive from using public virtual inheritance
- * @param base3 the third base class to derive from using public virtual inheritance
- * @param base4 the fourth base class to derive from using public virtual inheritance
- * @param base5 the fifth base class to derive from using public virtual inheritance
- * @param desc documentation comment for class
- */
-#define BEGIN_XMLOBJECT5(linkage,cname,base,base2,base3,base4,base5,desc) \
- XMLTOOLING_DOXYGEN(desc) \
- class linkage cname : public virtual base, public virtual base2, public virtual base3, public virtual base4, public virtual base5 { \
- protected: \
- cname() {} \
- public: \
- virtual ~cname() {} \
- XMLTOOLING_DOXYGEN(Type-specific clone method.) \
- virtual cname* clone##cname() const=0; \
- XMLTOOLING_DOXYGEN(Element local name) \
- static const XMLCh LOCAL_NAME[]
-
-/**
- * Ends the declaration of an XMLObject specialization.
- */
-#define END_XMLOBJECT }
-
-/**
- * Declares a static variable holding the XMLObject's element QName.
- */
-#define DECL_ELEMENT_QNAME \
- public: \
- XMLTOOLING_DOXYGEN(Element QName) \
- static xmltooling::QName ELEMENT_QNAME
-
-/**
- * Declares a static variable holding the XMLObject's schema type QName.
- */
-#define DECL_TYPE_QNAME \
- public: \
- XMLTOOLING_DOXYGEN(Type QName) \
- static xmltooling::QName TYPE_QNAME
-
-/**
- * Implements a static variable holding an XMLObject's element QName.
- *
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
-#define IMPL_ELEMENT_QNAME(cname,namespaceURI,namespacePrefix) \
- xmltooling::QName cname::ELEMENT_QNAME(namespaceURI,cname::LOCAL_NAME,namespacePrefix)
-
-/**
- * Implements a static variable holding an XMLObject's schema type QName.
- *
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
-#define IMPL_TYPE_QNAME(cname,namespaceURI,namespacePrefix) \
- xmltooling::QName cname::TYPE_QNAME(namespaceURI,cname::TYPE_NAME,namespacePrefix)
-
-/**
- * Declares abstract set method for a typed XML attribute.
- * The get method is omitted.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- * @param type the attribute's data type
- */
-#define DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,type) \
- public: \
- XMLTOOLING_DOXYGEN(proper attribute name) \
- static const XMLCh upcased##_ATTRIB_NAME[]; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(const type* proper)=0
-
-/**
- * Declares abstract get/set methods for a typed XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- * @param type the attribute's data type
- */
-#define DECL_XMLOBJECT_ATTRIB(proper,upcased,type) \
- public: \
- XMLTOOLING_DOXYGEN(proper attribute name) \
- static const XMLCh upcased##_ATTRIB_NAME[]; \
- XMLTOOLING_DOXYGEN(Returns the proper attribute.) \
- virtual const type* get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(const type* proper)=0
-
-/**
- * Declares abstract set method for a string XML attribute.
- * The get method is omitted.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_INHERITED_STRING_ATTRIB(proper,upcased) \
- DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
-
-/**
- * Declares abstract get/set methods for a string XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_STRING_ATTRIB(proper,upcased) \
- DECL_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
-
-/**
- * Declares abstract set method for a DateTime XML attribute.
- * The get method is omitted.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_INHERITED_DATETIME_ATTRIB(proper,upcased) \
- DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(time_t proper)=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(const XMLCh* proper)=0
-
-/**
- * Declares abstract get/set methods for a DateTime XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_DATETIME_ATTRIB(proper,upcased) \
- DECL_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
- XMLTOOLING_DOXYGEN(Returns the proper attribute in epoch form.) \
- virtual time_t get##proper##Epoch() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(time_t proper)=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(const XMLCh* proper)=0
-
-/**
- * Declares abstract set method for an integer XML attribute.
- * The get method is omitted.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_INHERITED_INTEGER_ATTRIB(proper,upcased) \
- public: \
- XMLTOOLING_DOXYGEN(proper attribute name) \
- static const XMLCh upcased##_ATTRIB_NAME[]; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
- virtual void set##proper(const XMLCh* proper)=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(int proper)=0
-
-/**
- * Declares abstract get/set methods for an integer XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- */
-#define DECL_INTEGER_ATTRIB(proper,upcased) \
- public: \
- XMLTOOLING_DOXYGEN(proper attribute name) \
- static const XMLCh upcased##_ATTRIB_NAME[]; \
- XMLTOOLING_DOXYGEN(Returns the proper attribute after a NULL indicator.) \
- virtual std::pair<bool,int> get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
- virtual void set##proper(const XMLCh* proper)=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- virtual void set##proper(int proper)=0
-
-/**
- * Declares abstract get/set methods for a boolean XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param upcased the upcased name of the attribute
- * @param def the default/presumed value, if no explicit value has been set
- */
-#define DECL_BOOLEAN_ATTRIB(proper,upcased,def) \
- public: \
- XMLTOOLING_DOXYGEN(proper attribute name) \
- static const XMLCh upcased##_ATTRIB_NAME[]; \
- XMLTOOLING_DOXYGEN(Returns the proper attribute or def if not set.) \
- bool proper() const { \
- switch (get##proper()) { \
- case xmlconstants::XML_BOOL_TRUE: \
- case xmlconstants::XML_BOOL_ONE: \
- return true; \
- case xmlconstants::XML_BOOL_FALSE: \
- case xmlconstants::XML_BOOL_ZERO: \
- return false; \
- default: \
- return def; \
- } \
- } \
- XMLTOOLING_DOXYGEN(Returns the proper attribute as an explicit enumerated value.) \
- virtual xmlconstants::xmltooling_bool_t get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute using an enumerated value.) \
- virtual void proper(xmlconstants::xmltooling_bool_t value)=0; \
- XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
- void proper(bool value) { \
- proper(value ? xmlconstants::XML_BOOL_ONE : xmlconstants::XML_BOOL_ZERO); \
- } \
- XMLTOOLING_DOXYGEN(Sets the proper attribute using a string constant.) \
- void set##proper(const XMLCh* value) { \
- if (value) { \
- switch (*value) { \
- case xercesc::chLatin_t: \
- proper(xmlconstants::XML_BOOL_TRUE); \
- break; \
- case xercesc::chLatin_f: \
- proper(xmlconstants::XML_BOOL_FALSE); \
- break; \
- case xercesc::chDigit_1: \
- proper(xmlconstants::XML_BOOL_ONE); \
- break; \
- case xercesc::chDigit_0: \
- proper(xmlconstants::XML_BOOL_ZERO); \
- break; \
- default: \
- proper(xmlconstants::XML_BOOL_NULL); \
- } \
- } \
- else \
- proper(xmlconstants::XML_BOOL_NULL); \
- }
-
-/**
- * Implements get/set methods and a private member for a typed XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param type the attribute's data type
- */
-#define IMPL_XMLOBJECT_ATTRIB(proper,type) \
- protected: \
- type* m_##proper; \
- public: \
- const type* get##proper() const { \
- return m_##proper; \
- } \
- void set##proper(const type* proper) { \
- m_##proper = prepareForAssignment(m_##proper,proper); \
- }
-
-/**
- * Implements get/set methods and a private member for a string XML attribute.
- *
- * @param proper the proper name of the attribute
- */
-#define IMPL_STRING_ATTRIB(proper) \
- IMPL_XMLOBJECT_ATTRIB(proper,XMLCh)
-
-/**
- * Implements get/set methods and a private member for a string XML attribute,
- * plus a getXMLID override.
- *
- * @param proper the proper name of the attribute
- */
-#define IMPL_ID_ATTRIB(proper) \
- IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \
- const XMLCh* getXMLID() const { \
- return m_##proper; \
- }
-
-/**
- * Implements get/set methods and a private member for a DateTime XML attribute.
- *
- * @param proper the proper name of the attribute
- * @param fallback epoch to return when attribute is NULL
- */
-#define IMPL_DATETIME_ATTRIB(proper,fallback) \
- protected: \
- DateTime* m_##proper; \
- time_t m_##proper##Epoch; \
- public: \
- const DateTime* get##proper() const { \
- return m_##proper; \
- } \
- time_t get##proper##Epoch() const { \
- return m_##proper ? m_##proper##Epoch : fallback; \
- } \
- void set##proper(const DateTime* proper) { \
- m_##proper = prepareForAssignment(m_##proper,proper); \
- if (m_##proper) \
- m_##proper##Epoch=m_##proper->getEpoch(); \
- } \
- void set##proper(time_t proper) { \
- m_##proper = prepareForAssignment(m_##proper,proper); \
- m_##proper##Epoch = proper; \
- } \
- void set##proper(const XMLCh* proper) { \
- m_##proper = prepareForAssignment(m_##proper,proper); \
- if (m_##proper) \
- m_##proper##Epoch=m_##proper->getEpoch(); \
- }
-
-/**
- * Implements get/set methods and a private member for an integer XML attribute.
- *
- * @param proper the proper name of the attribute
- */
-#define IMPL_INTEGER_ATTRIB(proper) \
- protected: \
- XMLCh* m_##proper; \
- public: \
- pair<bool,int> get##proper() const { \
- return make_pair((m_##proper!=NULL),(m_##proper!=NULL ? xercesc::XMLString::parseInt(m_##proper): 0)); \
- } \
- void set##proper(const XMLCh* proper) { \
- m_##proper = prepareForAssignment(m_##proper,proper); \
- } \
- void set##proper(int proper) { \
- char buf##proper[64]; \
- sprintf(buf##proper,"%d",proper); \
- auto_ptr_XMLCh wide##proper(buf##proper); \
- set##proper(wide##proper.get()); \
- }
-
-/**
- * Implements get/set methods and a private member for a boolean XML attribute.
- *
- * @param proper the proper name of the attribute
- */
-#define IMPL_BOOLEAN_ATTRIB(proper) \
- protected: \
- xmlconstants::xmltooling_bool_t m_##proper; \
- public: \
- xmlconstants::xmltooling_bool_t get##proper() const { \
- return m_##proper; \
- } \
- void proper(xmlconstants::xmltooling_bool_t value) { \
- if (m_##proper != value) { \
- releaseThisandParentDOM(); \
- m_##proper = value; \
- } \
- }
-
-/**
- * Declares abstract set method for a typed XML child object in a foreign namespace.
- * The get method is omitted.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- */
-#define DECL_INHERITED_TYPED_FOREIGN_CHILD(proper,ns) \
- public: \
- XMLTOOLING_DOXYGEN(Sets the proper child.) \
- virtual void set##proper(ns::proper* child)=0
-
-/**
- * Declares abstract get/set methods for a typed XML child object in a foreign namespace.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- */
-#define DECL_TYPED_FOREIGN_CHILD(proper,ns) \
- public: \
- XMLTOOLING_DOXYGEN(Returns the proper child.) \
- virtual ns::proper* get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper child.) \
- virtual void set##proper(ns::proper* child)=0
-
-/**
- * Declares abstract set method for a typed XML child object.
- * The get method is omitted.
- *
- * @param proper the proper name of the child type
- */
-#define DECL_INHERITED_TYPED_CHILD(proper) \
- public: \
- XMLTOOLING_DOXYGEN(Sets the proper child.) \
- virtual void set##proper(proper* child)=0
-
-/**
- * Declares abstract get/set methods for a typed XML child object.
- *
- * @param proper the proper name of the child type
- */
-#define DECL_TYPED_CHILD(proper) \
- public: \
- XMLTOOLING_DOXYGEN(Returns the proper child.) \
- virtual proper* get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper child.) \
- virtual void set##proper(proper* child)=0
-
-/**
- * Declares abstract get/set methods for a generic XML child object.
- *
- * @param proper the proper name of the child
- */
-#define DECL_XMLOBJECT_CHILD(proper) \
- public: \
- XMLTOOLING_DOXYGEN(Returns the proper child.) \
- virtual xmltooling::XMLObject* get##proper() const=0; \
- XMLTOOLING_DOXYGEN(Sets the proper child.) \
- virtual void set##proper(xmltooling::XMLObject* child)=0
-
-
-/**
- * Implements get/set methods and a private list iterator member for a typed XML child object.
- *
- * @param proper the proper name of the child type
- */
-#define IMPL_TYPED_CHILD(proper) \
- protected: \
- proper* m_##proper; \
- std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
- public: \
- proper* get##proper() const { \
- return m_##proper; \
- } \
- void set##proper(proper* child) { \
- prepareForAssignment(m_##proper,child); \
- *m_pos_##proper = m_##proper = child; \
- }
-
-/**
- * Implements get/set methods and a private list iterator member for
- * a typed XML child object in a foreign namespace
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- */
-#define IMPL_TYPED_FOREIGN_CHILD(proper,ns) \
- protected: \
- ns::proper* m_##proper; \
- std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
- public: \
- ns::proper* get##proper() const { \
- return m_##proper; \
- } \
- void set##proper(ns::proper* child) { \
- prepareForAssignment(m_##proper,child); \
- *m_pos_##proper = m_##proper = child; \
- }
-
-/**
- * Implements get/set methods and a private list iterator member for a generic XML child object.
- *
- * @param proper the proper name of the child
- */
-#define IMPL_XMLOBJECT_CHILD(proper) \
- protected: \
- xmltooling::XMLObject* m_##proper; \
- std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
- public: \
- xmltooling::XMLObject* get##proper() const { \
- return m_##proper; \
- } \
- void set##proper(xmltooling::XMLObject* child) { \
- prepareForAssignment(m_##proper,child); \
- *m_pos_##proper = m_##proper = child; \
- }
-
-/**
- * Declares abstract get/set methods for a typed XML child collection.
- *
- * @param proper the proper name of the child type
- */
-#define DECL_TYPED_CHILDREN(proper) \
- public: \
- XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
- virtual VectorOf(proper) get##proper##s()=0; \
- XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
- virtual const std::vector<proper*>& get##proper##s() const=0
-
-/**
- * Declares abstract get/set methods for a typed XML child collection in a foreign namespace.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- */
-#define DECL_TYPED_FOREIGN_CHILDREN(proper,ns) \
- public: \
- XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
- virtual VectorOf(ns::proper) get##proper##s()=0; \
- XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
- virtual const std::vector<ns::proper*>& get##proper##s() const=0
-
-/**
- * Declares abstract get/set methods for a generic XML child collection.
- *
- * @param proper the proper name of the child
- */
-#define DECL_XMLOBJECT_CHILDREN(proper) \
- public: \
- XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
- virtual VectorOf(xmltooling::XMLObject) get##proper##s()=0; \
- XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
- virtual const std::vector<xmltooling::XMLObject*>& get##proper##s() const=0
-
-/**
- * Implements get method and a private vector member for a typed XML child collection.
- *
- * @param proper the proper name of the child type
- * @param fence insertion fence for new objects of the child collection in backing list
- */
-#define IMPL_TYPED_CHILDREN(proper,fence) \
- protected: \
- std::vector<proper*> m_##proper##s; \
- public: \
- VectorOf(proper) get##proper##s() { \
- return VectorOf(proper)(this, m_##proper##s, &m_children, fence); \
- } \
- const std::vector<proper*>& get##proper##s() const { \
- return m_##proper##s; \
- }
-
-/**
- * Implements get method and a private vector member for a typed XML child collection
- * in a foreign namespace.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- * @param fence insertion fence for new objects of the child collection in backing list
- */
-#define IMPL_TYPED_FOREIGN_CHILDREN(proper,ns,fence) \
- protected: \
- std::vector<ns::proper*> m_##proper##s; \
- public: \
- VectorOf(ns::proper) get##proper##s() { \
- return VectorOf(ns::proper)(this, m_##proper##s, &m_children, fence); \
- } \
- const std::vector<ns::proper*>& get##proper##s() const { \
- return m_##proper##s; \
- }
-
-/**
- * Implements get method and a private vector member for a generic XML child collection.
- *
- * @param proper the proper name of the child
- * @param fence insertion fence for new objects of the child collection in backing list
- */
-#define IMPL_XMLOBJECT_CHILDREN(proper,fence) \
- protected: \
- std::vector<xmltooling::XMLObject*> m_##proper##s; \
- public: \
- VectorOf(xmltooling::XMLObject) get##proper##s() { \
- return VectorOf(xmltooling::XMLObject)(this, m_##proper##s, &m_children, fence); \
- } \
- const std::vector<xmltooling::XMLObject*>& get##proper##s() const { \
- return m_##proper##s; \
- }
-
-/**
- * Implements marshalling for a string attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_STRING_ATTRIB(proper,ucase,namespaceURI) \
- if (m_##proper && *m_##proper) { \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
- }
-
-/**
- * Implements marshalling for a DateTime attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_DATETIME_ATTRIB(proper,ucase,namespaceURI) \
- if (m_##proper) { \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper->getRawData()); \
- }
-
-/**
- * Implements marshalling for an integer attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
- if (m_##proper && *m_##proper) { \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
- }
-
-/**
- * Implements marshalling for a boolean attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
- switch (m_##proper) { \
- case xmlconstants::XML_BOOL_TRUE: \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_TRUE); \
- break; \
- case xmlconstants::XML_BOOL_ONE: \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ONE); \
- break; \
- case xmlconstants::XML_BOOL_FALSE: \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_FALSE); \
- break; \
- case xmlconstants::XML_BOOL_ZERO: \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ZERO); \
- break; \
- case xmlconstants::XML_BOOL_NULL: \
- break; \
- }
-
-/**
- * Implements marshalling for a QName attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_QNAME_ATTRIB(proper,ucase,namespaceURI) \
- if (m_##proper) { \
- auto_ptr_XMLCh qstr(m_##proper->toString().c_str()); \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, qstr.get()); \
- }
-
-/**
- * Implements marshalling for an ID attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \
- if (m_##proper && *m_##proper) { \
- domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
- domElement->setIdAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \
- }
-
-/**
- * Implements unmarshalling process branch for a string attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_STRING_ATTRIB(proper,ucase,namespaceURI) \
- if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
- set##proper(attribute->getValue()); \
- return; \
- }
-
-/**
- * Implements unmarshalling process branch for an ID attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_ID_ATTRIB(proper,ucase,namespaceURI) \
- if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
- set##proper(attribute->getValue()); \
- attribute->getOwnerElement()->setIdAttributeNode(attribute); \
- return; \
- }
-
-/**
- * Implements unmarshalling process branch for a DateTime attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_DATETIME_ATTRIB(proper,ucase,namespaceURI) \
- PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
-
-/**
- * Implements unmarshalling process branch for a DateTime attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_QNAME_ATTRIB(proper,ucase,namespaceURI) \
- if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
- set##proper(XMLHelper::getAttributeValueAsQName(attribute)); \
- return; \
- }
-
-/**
- * Implements unmarshalling process branch for an integer attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
- PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
-
-/**
- * Implements unmarshalling process branch for a boolean attribute
- *
- * @param proper the proper name of the attribute
- * @param ucase the upcased name of the attribute
- * @param namespaceURI the XML namespace of the attribute
- */
-#define PROC_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
- PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
-
-/**
- * Implements unmarshalling process branch for typed child collection element
- *
- * @param proper the proper name of the child type
- * @param namespaceURI the XML namespace of the child element
- * @param force bypass use of hint and just cast down to check child
- */
-#define PROC_TYPED_CHILDREN(proper,namespaceURI,force) \
- if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
- proper* typesafe=dynamic_cast<proper*>(childXMLObject); \
- if (typesafe) { \
- get##proper##s().push_back(typesafe); \
- return; \
- } \
- }
-
-/**
- * Implements unmarshalling process branch for typed child collection element
- * in a foreign namespace.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- * @param namespaceURI the XML namespace of the child element
- * @param force bypass use of hint and just cast down to check child
- */
-#define PROC_TYPED_FOREIGN_CHILDREN(proper,ns,namespaceURI,force) \
- if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
- ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
- if (typesafe) { \
- get##proper##s().push_back(typesafe); \
- return; \
- } \
- }
-
-/**
- * Implements unmarshalling process branch for typed child singleton element
- *
- * @param proper the proper name of the child type
- * @param namespaceURI the XML namespace of the child element
- * @param force bypass use of hint and just cast down to check child
- */
-#define PROC_TYPED_CHILD(proper,namespaceURI,force) \
- if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
- proper* typesafe=dynamic_cast<proper*>(childXMLObject); \
- if (typesafe && !m_##proper) { \
- typesafe->setParent(this); \
- *m_pos_##proper = m_##proper = typesafe; \
- return; \
- } \
- }
-
-/**
- * Implements unmarshalling process branch for typed child singleton element
- * in a foreign namespace.
- *
- * @param proper the proper name of the child type
- * @param ns the C++ namespace for the type
- * @param namespaceURI the XML namespace of the child element
- * @param force bypass use of hint and just cast down to check child
- */
-#define PROC_TYPED_FOREIGN_CHILD(proper,ns,namespaceURI,force) \
- if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
- ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
- if (typesafe && !m_##proper) { \
- typesafe->setParent(this); \
- *m_pos_##proper = m_##proper = typesafe; \
- return; \
- } \
- }
-
-/**
- * Implements unmarshalling process branch for a generic child singleton element
- *
- * @param proper the proper name of the child type
- * @param namespaceURI the XML namespace of the child element
- */
-#define PROC_XMLOBJECT_CHILD(proper,namespaceURI) \
- if (xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
- if (!m_##proper) { \
- childXMLObject->setParent(this); \
- *m_pos_##proper = m_##proper = childXMLObject; \
- return; \
- } \
- }
-
-/**
- * Declares aliased get/set methods for named XML element simple content.
- *
- * @param proper the proper name to label the element's content
- */
-#define DECL_SIMPLE_CONTENT(proper) \
- XMLTOOLING_DOXYGEN(Returns proper.) \
- const XMLCh* get##proper() const { \
- return getTextContent(); \
- } \
- XMLTOOLING_DOXYGEN(Sets or clears proper.) \
- void set##proper(const XMLCh* proper) { \
- setTextContent(proper); \
- }
-
-/**
- * Declares aliased get/set methods for named integer XML element content.
- *
- * @param proper the proper name to label the element's content
- */
-#define DECL_INTEGER_CONTENT(proper) \
- XMLTOOLING_DOXYGEN(Returns proper in integer form after a NULL indicator.) \
- std::pair<bool,int> get##proper() const { \
- return std::make_pair((getTextContent()!=NULL), (getTextContent()!=NULL ? xercesc::XMLString::parseInt(getTextContent()) : 0)); \
- } \
- XMLTOOLING_DOXYGEN(Sets proper.) \
- void set##proper(int proper) { \
- char buf[64]; \
- sprintf(buf,"%d",proper); \
- xmltooling::auto_ptr_XMLCh widebuf(buf); \
- setTextContent(widebuf.get()); \
- } \
- XMLTOOLING_DOXYGEN(Sets or clears proper.) \
- void set##proper(const XMLCh* proper) { \
- setTextContent(proper); \
- }
-
-/**
- * Implements cloning methods for an XMLObject specialization implementation class.
- *
- * @param cname the name of the XMLObject specialization
- */
-#define IMPL_XMLOBJECT_CLONE(cname) \
- cname* clone##cname() const { \
- return dynamic_cast<cname*>(clone()); \
- } \
- xmltooling::XMLObject* clone() const { \
- std::auto_ptr<xmltooling::XMLObject> domClone(xmltooling::AbstractDOMCachingXMLObject::clone()); \
- cname##Impl* ret=dynamic_cast<cname##Impl*>(domClone.get()); \
- if (ret) { \
- domClone.release(); \
- return ret; \
- } \
- return new cname##Impl(*this); \
- }
-
-/**
- * Declares an XMLObject specialization with a simple content model and type,
- * handling it as string data.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- * @param proper the proper name to label the element's content
- * @param desc documentation for class
- */
-#define DECL_XMLOBJECT_SIMPLE(linkage,cname,proper,desc) \
- BEGIN_XMLOBJECT(linkage,cname,xmltooling::XMLObject,desc); \
- DECL_SIMPLE_CONTENT(proper); \
- END_XMLOBJECT
-
-/**
- * Declares and defines an implementation class for an XMLObject with
- * a simple content model and type, handling it as string data.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- */
-#define DECL_XMLOBJECTIMPL_SIMPLE(linkage,cname) \
- class linkage cname##Impl \
- : public virtual cname, \
- public xmltooling::AbstractSimpleElement, \
- public xmltooling::AbstractDOMCachingXMLObject, \
- public xmltooling::AbstractXMLObjectMarshaller, \
- public xmltooling::AbstractXMLObjectUnmarshaller \
- { \
- public: \
- virtual ~cname##Impl() {} \
- cname##Impl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) \
- : xmltooling::AbstractXMLObject(nsURI, localName, prefix, schemaType) { \
- } \
- cname##Impl(const cname##Impl& src) \
- : xmltooling::AbstractXMLObject(src), \
- xmltooling::AbstractSimpleElement(src), \
- xmltooling::AbstractDOMCachingXMLObject(src) {} \
- IMPL_XMLOBJECT_CLONE(cname) \
- }
-
-#ifdef HAVE_COVARIANT_RETURNS
-
-/**
- * Begins the declaration of an XMLObjectBuilder specialization.
- * Basic boilerplate includes an empty virtual destructor, and
- * a default builder that defaults the element name.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
-#define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
- XMLTOOLING_DOXYGEN(Builder for cname objects.) \
- class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \
- public: \
- virtual ~cname##Builder() {} \
- XMLTOOLING_DOXYGEN(Default builder.) \
- virtual cname* buildObject() const { \
- return buildObject(namespaceURI,cname::LOCAL_NAME,namespacePrefix); \
- } \
- XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \
- virtual cname* buildObject( \
- const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \
- ) const
-
-/**
- * Ends the declaration of an XMLObjectBuilder specialization.
- */
-#define END_XMLOBJECTBUILDER }
-
-/**
- * Declares a generic XMLObjectBuilder specialization.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
- #define DECL_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
- BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix); \
- XMLTOOLING_DOXYGEN(Singleton builder.) \
- static cname* build##cname() { \
- const cname##Builder* b = dynamic_cast<const cname##Builder*>( \
- XMLObjectBuilder::getBuilder(xmltooling::QName(namespaceURI,cname::LOCAL_NAME)) \
- ); \
- if (b) \
- return b->buildObject(); \
- throw xmltooling::XMLObjectException("Unable to obtain typed builder for "#cname"."); \
- } \
- END_XMLOBJECTBUILDER
-
-/**
- * Implements the standard XMLObjectBuilder specialization function.
- *
- * @param cname the name of the XMLObject specialization
- */
-#define IMPL_XMLOBJECTBUILDER(cname) \
- cname* cname##Builder::buildObject( \
- const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \
- ) const \
- { \
- return new cname##Impl(nsURI,localName,prefix,schemaType); \
- }
-
-#else /* !HAVE_COVARIANT_RETURNS */
-
-/**
- * Begins the declaration of an XMLObjectBuilder specialization.
- * Basic boilerplate includes an empty virtual destructor, and
- * a default builder that defaults the element name.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
-#define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
- XMLTOOLING_DOXYGEN(Builder for cname objects.) \
- class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \
- public: \
- virtual ~cname##Builder() {} \
- XMLTOOLING_DOXYGEN(Default builder.) \
- virtual xmltooling::XMLObject* buildObject() const { \
- return buildObject(namespaceURI,cname::LOCAL_NAME,namespacePrefix); \
- } \
- XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \
- virtual xmltooling::XMLObject* buildObject( \
- const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \
- ) const
-
-/**
- * Ends the declaration of an XMLObjectBuilder specialization.
- */
-#define END_XMLOBJECTBUILDER }
-
-/**
- * Declares a generic XMLObjectBuilder specialization.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- * @param namespaceURI the XML namespace of the default associated element
- * @param namespacePrefix the XML namespace prefix of the default associated element
- */
- #define DECL_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
- BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix); \
- XMLTOOLING_DOXYGEN(Singleton builder.) \
- static cname* build##cname() { \
- const cname##Builder* b = dynamic_cast<const cname##Builder*>( \
- XMLObjectBuilder::getBuilder(xmltooling::QName(namespaceURI,cname::LOCAL_NAME)) \
- ); \
- if (b) \
- return dynamic_cast<cname*>(b->buildObject()); \
- throw xmltooling::XMLObjectException("Unable to obtain typed builder for "#cname"."); \
- } \
- END_XMLOBJECTBUILDER
-
-/**
- * Implements the standard XMLObjectBuilder specialization function.
- *
- * @param cname the name of the XMLObject specialization
- */
-#define IMPL_XMLOBJECTBUILDER(cname) \
- xmltooling::XMLObject* cname##Builder::buildObject( \
- const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \
- ) const \
- { \
- return new cname##Impl(nsURI,localName,prefix,schemaType); \
- }
-
-#endif /* HAVE_COVARIANT_RETURNS */
-
-/**
- * Begins the declaration of a Schema Validator specialization.
- *
- * @param linkage linkage specifier for the class
- * @param cname the base name of the Validator specialization
- */
- #define BEGIN_XMLOBJECTVALIDATOR(linkage,cname) \
- class linkage cname##SchemaValidator : public xmltooling::Validator \
- { \
- public: \
- virtual ~cname##SchemaValidator() {} \
- virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
- const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
- if (!ptr) \
- throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())); \
- if (ptr->nil() && (ptr->hasChildren() || ptr->getTextContent())) \
- throw xmltooling::ValidationException("Object has nil property but with children or content.")
-
-/**
- * Begins the declaration of a Schema Validator specialization subclass.
- *
- * @param linkage linkage specifier for the class
- * @param cname the base name of the Validator specialization
- * @param base base class for the validator
- */
- #define BEGIN_XMLOBJECTVALIDATOR_SUB(linkage,cname,base) \
- class linkage cname##SchemaValidator : public base##SchemaValidator \
- { \
- public: \
- virtual ~cname##SchemaValidator() {} \
- virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
- const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
- if (!ptr) \
- throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name()));
-
-/**
- * Ends the declaration of a Validator specialization.
- */
-#define END_XMLOBJECTVALIDATOR } }
-
-/**
- * Validator code that checks the object type.
- *
- * @param cname the name of the XMLObject specialization
- */
-#define XMLOBJECTVALIDATOR_CHECKTYPE(cname) \
- const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
- if (!ptr) \
- throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name()))
-
-/**
- * Validator code that checks for a required attribute, content, or singleton.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper the proper name of the attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_REQUIRE(cname,proper) \
- if (!ptr->get##proper()) \
- throw xmltooling::ValidationException(#cname" must have "#proper".")
-
-/**
- * Validator code that checks for a required integer attribute
- *
- * @param cname the name of the XMLObject specialization
- * @param proper the proper name of the attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_REQUIRE_INTEGER(cname,proper) \
- if (!ptr->get##proper().first) \
- throw xmltooling::ValidationException(#cname" must have "#proper".")
-
-/**
- * Validator code that checks for one of a pair of
- * required attributes, content, or singletons.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper1 the proper name of the first attribute, content, or singleton member
- * @param proper2 the proper name of the second attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_ONEOF(cname,proper1,proper2) \
- if (!ptr->get##proper1() && !ptr->get##proper2()) \
- throw xmltooling::ValidationException(#cname" must have "#proper1" or "#proper2".")
-
-/**
- * Validator code that checks for one of a pair of
- * required attributes, content, or singletons, but disallows both.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper1 the proper name of the first attribute, content, or singleton member
- * @param proper2 the proper name of the second attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_ONLYONEOF(cname,proper1,proper2) \
- if ((!ptr->get##proper1() && !ptr->get##proper2()) || (ptr->get##proper1() && ptr->get##proper2())) \
- throw xmltooling::ValidationException(#cname" must have "#proper1" or "#proper2" but not both.")
-
-/**
- * Validator code that checks for one of a set of three
- * required attributes, content, or singletons.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper1 the proper name of the first attribute, content, or singleton member
- * @param proper2 the proper name of the second attribute, content, or singleton member
- * @param proper3 the proper name of the third attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_ONEOF3(cname,proper1,proper2,proper3) \
- if (!ptr->get##proper1() && !ptr->get##proper2() && !ptr->get##proper3()) \
- throw xmltooling::ValidationException(#cname" must have "#proper1", "#proper2", or "#proper3".")
-
-/**
- * Validator code that checks for one of a set of three
- * required attributes, content, or singletons but disallows more than one.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper1 the proper name of the first attribute, content, or singleton member
- * @param proper2 the proper name of the second attribute, content, or singleton member
- * @param proper3 the proper name of the third attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_ONLYONEOF3(cname,proper1,proper2,proper3) \
- int c##proper1##proper2##proper3=0; \
- if (ptr->get##proper1()!=NULL) \
- c##proper1##proper2##proper3++; \
- if (ptr->get##proper2()!=NULL) \
- c##proper1##proper2##proper3++; \
- if (ptr->get##proper3()!=NULL) \
- c##proper1##proper2##proper3++; \
- if (c##proper1##proper2##proper3 != 1) \
- throw xmltooling::ValidationException(#cname" must have only one of "#proper1", "#proper2", or "#proper3".")
-
-/**
- * Validator code that checks a co-constraint (if one present, the other must be)
- * between a pair of attributes, content, or singletons.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper1 the proper name of the first attribute, content, or singleton member
- * @param proper2 the proper name of the second attribute, content, or singleton member
- */
-#define XMLOBJECTVALIDATOR_NONEORBOTH(cname,proper1,proper2) \
- if ((ptr->get##proper1() && !ptr->get##proper2()) || (!ptr->get##proper1() && ptr->get##proper2())) \
- throw xmltooling::ValidationException(#cname" cannot have "#proper1" without "#proper2".")
-
-/**
- * Validator code that checks for a non-empty collection.
- *
- * @param cname the name of the XMLObject specialization
- * @param proper the proper name of the collection item
- */
-#define XMLOBJECTVALIDATOR_NONEMPTY(cname,proper) \
- if (ptr->get##proper##s().empty()) \
- throw xmltooling::ValidationException(#cname" must have at least one "#proper".")
-
-/**
- * Declares/defines a Validator specialization that checks object type and
- * a non-empty simple content model.
- *
- * @param linkage linkage specifier for the class
- * @param cname the name of the XMLObject specialization
- */
-#define XMLOBJECTVALIDATOR_SIMPLE(linkage,cname) \
- BEGIN_XMLOBJECTVALIDATOR(linkage,cname); \
- XMLOBJECTVALIDATOR_REQUIRE(cname,TextContent); \
- END_XMLOBJECTVALIDATOR
-
-#include <utility>
-
-/**
- * @namespace xmltooling
- * Public namespace of XML Tooling library
- */
-namespace xmltooling {
-
- /**
- * Template function for cloning a sequence of XMLObjects.
- * Invokes the clone() member on each element of the input sequence and adds the copy to
- * the output sequence. Order is preserved.
- *
- * @param in input sequence to clone
- * @param out output sequence to copy cloned pointers into
- */
- template<class InputSequence,class OutputSequence> void clone(const InputSequence& in, OutputSequence& out) {
- for (typename InputSequence::const_iterator i=in.begin(); i!=in.end(); i++) {
- if (*i)
- out.push_back((*i)->clone());
- else
- out.push_back(*i);
- }
- }
-
- /**
- * Functor for cleaning up heap objects in containers.
- */
- template<class T> struct cleanup
- {
- /**
- * Function operator to delete an object.
- *
- * @param ptr object to delete
- */
- void operator()(T* ptr) {delete ptr;}
-
- /**
- * Function operator to delete an object stored as const.
- *
- * @param ptr object to delete after casting away const
- */
- void operator()(const T* ptr) {delete const_cast<T*>(ptr);}
- };
-
- /**
- * Functor for cleaning up heap objects in key/value containers.
- */
- template<class A,class B> struct cleanup_pair
- {
- /**
- * Function operator to delete an object.
- *
- * @param p a pair in which the second component is the object to delete
- */
- void operator()(const std::pair<const A,B*>& p) {delete p.second;}
- };
-
- /**
- * Functor for cleaning up const heap objects in key/value containers.
- */
- template<class A,class B> struct cleanup_const_pair
- {
- /**
- * Function operator to delete an object stored as const
- *
- * @param p a pair in which the second component is the const object to delete
- */
- void operator()(const std::pair<const A,const B*>& p) {delete const_cast<B*>(p.second);}
- };
-};
-
-#endif /* __xmltooling_base_h__ */
+/*
+ * Copyright 2001-2007 Internet2
+ *
+ * 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.
+ */
+
+/**
+ * @file xmltooling/base.h
+ *
+ * Base header file definitions
+ * Must be included prior to including any other header
+ */
+
+#ifndef __xmltooling_base_h__
+#define __xmltooling_base_h__
+
+#include <typeinfo>
+
+#if defined (_MSC_VER) || defined(__BORLANDC__)
+ #include <xmltooling/config_pub_win32.h>
+#else
+ #include <xmltooling/config_pub.h>
+#endif
+
+#ifdef XMLTOOLING_LITE
+# define XMLTOOLING_NO_XMLSEC 1
+#endif
+
+// Windows and GCC4 Symbol Visibility Macros
+#ifdef WIN32
+ #define XMLTOOL_IMPORT __declspec(dllimport)
+ #define XMLTOOL_EXPORT __declspec(dllexport)
+ #define XMLTOOL_DLLLOCAL
+ #define XMLTOOL_DLLPUBLIC
+#else
+ #define XMLTOOL_IMPORT
+ #ifdef GCC_HASCLASSVISIBILITY
+ #define XMLTOOL_EXPORT __attribute__ ((visibility("default")))
+ #define XMLTOOL_DLLLOCAL __attribute__ ((visibility("hidden")))
+ #define XMLTOOL_DLLPUBLIC __attribute__ ((visibility("default")))
+ #else
+ #define XMLTOOL_EXPORT
+ #define XMLTOOL_DLLLOCAL
+ #define XMLTOOL_DLLPUBLIC
+ #endif
+#endif
+
+// Define XMLTOOL_API for DLL builds
+#ifdef XMLTOOLING_EXPORTS
+ #define XMLTOOL_API XMLTOOL_EXPORT
+#else
+ #define XMLTOOL_API XMLTOOL_IMPORT
+#endif
+
+// Throwable classes must always be visible on GCC in all binaries
+#ifdef WIN32
+ #define XMLTOOL_EXCEPTIONAPI(api) api
+#elif defined(GCC_HASCLASSVISIBILITY)
+ #define XMLTOOL_EXCEPTIONAPI(api) XMLTOOL_EXPORT
+#else
+ #define XMLTOOL_EXCEPTIONAPI(api)
+#endif
+
+#ifdef _MSC_VER
+ #define XMLTOOLING_DOXYGEN(desc) /##** desc */
+#else
+ #define XMLTOOLING_DOXYGEN(desc)
+#endif
+
+/**
+ * Blocks copy c'tor and assignment operator for a class.
+ */
+#define MAKE_NONCOPYABLE(type) \
+ private: \
+ type(const type&); \
+ type& operator=(const type&)
+
+#ifndef DOXYGEN_SKIP
+#ifndef NULL
+#define NULL 0
+#endif
+#define UNICODE_LITERAL_1(a) {xercesc::chLatin_##a, xercesc::chNull}
+#define UNICODE_LITERAL_2(a,b) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chNull}
+#define UNICODE_LITERAL_3(a,b,c) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chNull}
+#define UNICODE_LITERAL_4(a,b,c,d) {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chNull}
+#define UNICODE_LITERAL_5(a,b,c,d,e) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chNull}
+#define UNICODE_LITERAL_6(a,b,c,d,e,f) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chNull}
+#define UNICODE_LITERAL_7(a,b,c,d,e,f,g) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chNull}
+#define UNICODE_LITERAL_8(a,b,c,d,e,f,g,h) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chNull}
+#define UNICODE_LITERAL_9(a,b,c,d,e,f,g,h,i) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, xercesc::chNull}
+#define UNICODE_LITERAL_10(a,b,c,d,e,f,g,h,i,j) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chNull}
+#define UNICODE_LITERAL_11(a,b,c,d,e,f,g,h,i,j,k) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chNull}
+#define UNICODE_LITERAL_12(a,b,c,d,e,f,g,h,i,j,k,l) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chNull}
+#define UNICODE_LITERAL_13(a,b,c,d,e,f,g,h,i,j,k,l,m) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chNull}
+#define UNICODE_LITERAL_14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chNull}
+#define UNICODE_LITERAL_15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chNull}
+#define UNICODE_LITERAL_16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chNull}
+#define UNICODE_LITERAL_17(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chNull}
+#define UNICODE_LITERAL_18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, xercesc::chNull}
+#define UNICODE_LITERAL_19(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chNull}
+#define UNICODE_LITERAL_20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chNull}
+#define UNICODE_LITERAL_21(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chNull}
+#define UNICODE_LITERAL_22(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chNull}
+#define UNICODE_LITERAL_23(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chNull}
+#define UNICODE_LITERAL_24(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chNull}
+#define UNICODE_LITERAL_25(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chNull}
+#define UNICODE_LITERAL_26(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, xercesc::chNull}
+#define UNICODE_LITERAL_27(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chNull}
+#define UNICODE_LITERAL_28(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chNull}
+#define UNICODE_LITERAL_29(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chNull}
+#define UNICODE_LITERAL_30(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chNull}
+#define UNICODE_LITERAL_31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chNull}
+#define UNICODE_LITERAL_32(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chNull}
+#define UNICODE_LITERAL_33(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chLatin_##gg, xercesc::chNull}
+#define UNICODE_LITERAL_34(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg,hh) \
+ {xercesc::chLatin_##a, xercesc::chLatin_##b, xercesc::chLatin_##c, xercesc::chLatin_##d, xercesc::chLatin_##e, xercesc::chLatin_##f, xercesc::chLatin_##g, xercesc::chLatin_##h, xercesc::chLatin_##i, \
+ xercesc::chLatin_##j, xercesc::chLatin_##k, xercesc::chLatin_##l, xercesc::chLatin_##m, xercesc::chLatin_##n, xercesc::chLatin_##o, xercesc::chLatin_##p, xercesc::chLatin_##q, xercesc::chLatin_##r, \
+ xercesc::chLatin_##s, xercesc::chLatin_##t, xercesc::chLatin_##u, xercesc::chLatin_##v, xercesc::chLatin_##w, xercesc::chLatin_##x, xercesc::chLatin_##y, xercesc::chLatin_##z, \
+ xercesc::chLatin_##aa, xercesc::chLatin_##bb, xercesc::chLatin_##cc, xercesc::chLatin_##dd, xercesc::chLatin_##ee, xercesc::chLatin_##ff, xercesc::chLatin_##gg, xercesc::chLatin_##hh, xercesc::chNull}
+#endif /* DOXYGEN_SKIP */
+
+/**
+ * Begins the declaration of an XMLObject specialization for an abstract element/type.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define DECL_XMLOBJECT_ABSTRACT(linkage,cname,base,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]; \
+ }
+
+/**
+ * Begins the declaration of an XMLObject specialization.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define BEGIN_XMLOBJECT(linkage,cname,base,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+ virtual cname* clone##cname() const=0; \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with two base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the first base class to derive from using public virtual inheritance
+ * @param base2 the second base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define BEGIN_XMLOBJECT2(linkage,cname,base,base2,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base, public virtual base2 { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+ virtual cname* clone##cname() const=0; \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with three base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the first base class to derive from using public virtual inheritance
+ * @param base2 the second base class to derive from using public virtual inheritance
+ * @param base3 the third base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define BEGIN_XMLOBJECT3(linkage,cname,base,base2,base3,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base, public virtual base2, public virtual base3 { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+ virtual cname* clone##cname() const=0; \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with four base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the first base class to derive from using public virtual inheritance
+ * @param base2 the second base class to derive from using public virtual inheritance
+ * @param base3 the third base class to derive from using public virtual inheritance
+ * @param base4 the fourth base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define BEGIN_XMLOBJECT4(linkage,cname,base,base2,base3,base4,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base, public virtual base2, public virtual base3, public virtual base4 { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+ virtual cname* clone##cname() const=0; \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]
+
+/**
+ * Begins the declaration of an XMLObject specialization with five base classes.
+ * Basic boilerplate includes a protected constructor, empty virtual destructor,
+ * and Unicode constants for the default associated element's name and prefix.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the class to declare
+ * @param base the first base class to derive from using public virtual inheritance
+ * @param base2 the second base class to derive from using public virtual inheritance
+ * @param base3 the third base class to derive from using public virtual inheritance
+ * @param base4 the fourth base class to derive from using public virtual inheritance
+ * @param base5 the fifth base class to derive from using public virtual inheritance
+ * @param desc documentation comment for class
+ */
+#define BEGIN_XMLOBJECT5(linkage,cname,base,base2,base3,base4,base5,desc) \
+ XMLTOOLING_DOXYGEN(desc) \
+ class linkage cname : public virtual base, public virtual base2, public virtual base3, public virtual base4, public virtual base5 { \
+ protected: \
+ cname() {} \
+ public: \
+ virtual ~cname() {} \
+ XMLTOOLING_DOXYGEN(Type-specific clone method.) \
+ virtual cname* clone##cname() const=0; \
+ XMLTOOLING_DOXYGEN(Element local name) \
+ static const XMLCh LOCAL_NAME[]
+
+/**
+ * Ends the declaration of an XMLObject specialization.
+ */
+#define END_XMLOBJECT }
+
+/**
+ * Declares a static variable holding the XMLObject's element QName.
+ */
+#define DECL_ELEMENT_QNAME \
+ public: \
+ XMLTOOLING_DOXYGEN(Element QName) \
+ static xmltooling::QName ELEMENT_QNAME
+
+/**
+ * Declares a static variable holding the XMLObject's schema type QName.
+ */
+#define DECL_TYPE_QNAME \
+ public: \
+ XMLTOOLING_DOXYGEN(Type QName) \
+ static xmltooling::QName TYPE_QNAME
+
+/**
+ * Implements a static variable holding an XMLObject's element QName.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+#define IMPL_ELEMENT_QNAME(cname,namespaceURI,namespacePrefix) \
+ xmltooling::QName cname::ELEMENT_QNAME(namespaceURI,cname::LOCAL_NAME,namespacePrefix)
+
+/**
+ * Implements a static variable holding an XMLObject's schema type QName.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+#define IMPL_TYPE_QNAME(cname,namespaceURI,namespacePrefix) \
+ xmltooling::QName cname::TYPE_QNAME(namespaceURI,cname::TYPE_NAME,namespacePrefix)
+
+/**
+ * Declares abstract set method for a typed XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ * @param type the attribute's data type
+ */
+#define DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,type) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const type* proper)=0
+
+/**
+ * Declares abstract get/set methods for a typed XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ * @param type the attribute's data type
+ */
+#define DECL_XMLOBJECT_ATTRIB(proper,upcased,type) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute.) \
+ virtual const type* get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const type* proper)=0
+
+/**
+ * Declares abstract set method for a string XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INHERITED_STRING_ATTRIB(proper,upcased) \
+ DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
+
+/**
+ * Declares abstract get/set methods for a string XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_STRING_ATTRIB(proper,upcased) \
+ DECL_XMLOBJECT_ATTRIB(proper,upcased,XMLCh)
+
+/**
+ * Declares abstract set method for a DateTime XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INHERITED_DATETIME_ATTRIB(proper,upcased) \
+ DECL_INHERITED_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(time_t proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const XMLCh* proper)=0
+
+/**
+ * Declares abstract get/set methods for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_DATETIME_ATTRIB(proper,upcased) \
+ DECL_XMLOBJECT_ATTRIB(proper,upcased,xmltooling::DateTime); \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute in epoch form.) \
+ virtual time_t get##proper##Epoch() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(time_t proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(const XMLCh* proper)=0
+
+/**
+ * Declares abstract set method for an integer XML attribute.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INHERITED_INTEGER_ATTRIB(proper,upcased) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
+ virtual void set##proper(const XMLCh* proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(int proper)=0
+
+/**
+ * Declares abstract get/set methods for an integer XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ */
+#define DECL_INTEGER_ATTRIB(proper,upcased) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute after a NULL indicator.) \
+ virtual std::pair<bool,int> get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string value.) \
+ virtual void set##proper(const XMLCh* proper)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ virtual void set##proper(int proper)=0
+
+/**
+ * Declares abstract get/set methods for a boolean XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param upcased the upcased name of the attribute
+ * @param def the default/presumed value, if no explicit value has been set
+ */
+#define DECL_BOOLEAN_ATTRIB(proper,upcased,def) \
+ public: \
+ XMLTOOLING_DOXYGEN(proper attribute name) \
+ static const XMLCh upcased##_ATTRIB_NAME[]; \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute or def if not set.) \
+ bool proper() const { \
+ switch (get##proper()) { \
+ case xmlconstants::XML_BOOL_TRUE: \
+ case xmlconstants::XML_BOOL_ONE: \
+ return true; \
+ case xmlconstants::XML_BOOL_FALSE: \
+ case xmlconstants::XML_BOOL_ZERO: \
+ return false; \
+ default: \
+ return def; \
+ } \
+ } \
+ XMLTOOLING_DOXYGEN(Returns the proper attribute as an explicit enumerated value.) \
+ virtual xmlconstants::xmltooling_bool_t get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using an enumerated value.) \
+ virtual void proper(xmlconstants::xmltooling_bool_t value)=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute.) \
+ void proper(bool value) { \
+ proper(value ? xmlconstants::XML_BOOL_ONE : xmlconstants::XML_BOOL_ZERO); \
+ } \
+ XMLTOOLING_DOXYGEN(Sets the proper attribute using a string constant.) \
+ void set##proper(const XMLCh* value) { \
+ if (value) { \
+ switch (*value) { \
+ case xercesc::chLatin_t: \
+ proper(xmlconstants::XML_BOOL_TRUE); \
+ break; \
+ case xercesc::chLatin_f: \
+ proper(xmlconstants::XML_BOOL_FALSE); \
+ break; \
+ case xercesc::chDigit_1: \
+ proper(xmlconstants::XML_BOOL_ONE); \
+ break; \
+ case xercesc::chDigit_0: \
+ proper(xmlconstants::XML_BOOL_ZERO); \
+ break; \
+ default: \
+ proper(xmlconstants::XML_BOOL_NULL); \
+ } \
+ } \
+ else \
+ proper(xmlconstants::XML_BOOL_NULL); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a typed XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param type the attribute's data type
+ */
+#define IMPL_XMLOBJECT_ATTRIB(proper,type) \
+ protected: \
+ type* m_##proper; \
+ public: \
+ const type* get##proper() const { \
+ return m_##proper; \
+ } \
+ void set##proper(const type* proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a string XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_STRING_ATTRIB(proper) \
+ IMPL_XMLOBJECT_ATTRIB(proper,XMLCh)
+
+/**
+ * Implements get/set methods and a private member for a string XML attribute,
+ * plus a getXMLID override.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_ID_ATTRIB(proper) \
+ IMPL_XMLOBJECT_ATTRIB(proper,XMLCh) \
+ const XMLCh* getXMLID() const { \
+ return m_##proper; \
+ }
+
+/**
+ * Implements get/set methods and a private member for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ */
+#define IMPL_DATETIME_ATTRIB(proper,fallback) \
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,false)
+
+/**
+ * Implements get/set methods and a private member for a duration-valued DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ */
+#define IMPL_DURATION_ATTRIB(proper,fallback) \
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,true)
+
+/**
+ * Implements get/set methods and a private member for a DateTime XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ * @param fallback epoch to return when attribute is NULL
+ * @param duration true iff the attribute should be handled as a duration
+ */
+#define IMPL_DATETIME_ATTRIB_EX(proper,fallback,duration) \
+ protected: \
+ DateTime* m_##proper; \
+ time_t m_##proper##Epoch; \
+ public: \
+ const DateTime* get##proper() const { \
+ return m_##proper; \
+ } \
+ time_t get##proper##Epoch() const { \
+ return m_##proper ? m_##proper##Epoch : fallback; \
+ } \
+ void set##proper(const DateTime* proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper); \
+ if (m_##proper) \
+ m_##proper##Epoch=m_##proper->getEpoch(); \
+ } \
+ void set##proper(time_t proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper,duration); \
+ m_##proper##Epoch = proper; \
+ } \
+ void set##proper(const XMLCh* proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper,duration); \
+ if (m_##proper) \
+ m_##proper##Epoch=m_##proper->getEpoch(); \
+ }
+
+/**
+ * Implements get/set methods and a private member for an integer XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_INTEGER_ATTRIB(proper) \
+ protected: \
+ XMLCh* m_##proper; \
+ public: \
+ pair<bool,int> get##proper() const { \
+ return make_pair((m_##proper!=NULL),(m_##proper!=NULL ? xercesc::XMLString::parseInt(m_##proper): 0)); \
+ } \
+ void set##proper(const XMLCh* proper) { \
+ m_##proper = prepareForAssignment(m_##proper,proper); \
+ } \
+ void set##proper(int proper) { \
+ char buf##proper[64]; \
+ sprintf(buf##proper,"%d",proper); \
+ auto_ptr_XMLCh wide##proper(buf##proper); \
+ set##proper(wide##proper.get()); \
+ }
+
+/**
+ * Implements get/set methods and a private member for a boolean XML attribute.
+ *
+ * @param proper the proper name of the attribute
+ */
+#define IMPL_BOOLEAN_ATTRIB(proper) \
+ protected: \
+ xmlconstants::xmltooling_bool_t m_##proper; \
+ public: \
+ xmlconstants::xmltooling_bool_t get##proper() const { \
+ return m_##proper; \
+ } \
+ void proper(xmlconstants::xmltooling_bool_t value) { \
+ if (m_##proper != value) { \
+ releaseThisandParentDOM(); \
+ m_##proper = value; \
+ } \
+ }
+
+/**
+ * Declares abstract set method for a typed XML child object in a foreign namespace.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ */
+#define DECL_INHERITED_TYPED_FOREIGN_CHILD(proper,ns) \
+ public: \
+ XMLTOOLING_DOXYGEN(Sets the proper child.) \
+ virtual void set##proper(ns::proper* child)=0
+
+/**
+ * Declares abstract get/set methods for a typed XML child object in a foreign namespace.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ */
+#define DECL_TYPED_FOREIGN_CHILD(proper,ns) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns the proper child.) \
+ virtual ns::proper* get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper child.) \
+ virtual void set##proper(ns::proper* child)=0
+
+/**
+ * Declares abstract set method for a typed XML child object.
+ * The get method is omitted.
+ *
+ * @param proper the proper name of the child type
+ */
+#define DECL_INHERITED_TYPED_CHILD(proper) \
+ public: \
+ XMLTOOLING_DOXYGEN(Sets the proper child.) \
+ virtual void set##proper(proper* child)=0
+
+/**
+ * Declares abstract get/set methods for a typed XML child object.
+ *
+ * @param proper the proper name of the child type
+ */
+#define DECL_TYPED_CHILD(proper) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns the proper child.) \
+ virtual proper* get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper child.) \
+ virtual void set##proper(proper* child)=0
+
+/**
+ * Declares abstract get/set methods for a generic XML child object.
+ *
+ * @param proper the proper name of the child
+ */
+#define DECL_XMLOBJECT_CHILD(proper) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns the proper child.) \
+ virtual xmltooling::XMLObject* get##proper() const=0; \
+ XMLTOOLING_DOXYGEN(Sets the proper child.) \
+ virtual void set##proper(xmltooling::XMLObject* child)=0
+
+
+/**
+ * Implements get/set methods and a private list iterator member for a typed XML child object.
+ *
+ * @param proper the proper name of the child type
+ */
+#define IMPL_TYPED_CHILD(proper) \
+ protected: \
+ proper* m_##proper; \
+ std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
+ public: \
+ proper* get##proper() const { \
+ return m_##proper; \
+ } \
+ void set##proper(proper* child) { \
+ prepareForAssignment(m_##proper,child); \
+ *m_pos_##proper = m_##proper = child; \
+ }
+
+/**
+ * Implements get/set methods and a private list iterator member for
+ * a typed XML child object in a foreign namespace
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ */
+#define IMPL_TYPED_FOREIGN_CHILD(proper,ns) \
+ protected: \
+ ns::proper* m_##proper; \
+ std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
+ public: \
+ ns::proper* get##proper() const { \
+ return m_##proper; \
+ } \
+ void set##proper(ns::proper* child) { \
+ prepareForAssignment(m_##proper,child); \
+ *m_pos_##proper = m_##proper = child; \
+ }
+
+/**
+ * Implements get/set methods and a private list iterator member for a generic XML child object.
+ *
+ * @param proper the proper name of the child
+ */
+#define IMPL_XMLOBJECT_CHILD(proper) \
+ protected: \
+ xmltooling::XMLObject* m_##proper; \
+ std::list<xmltooling::XMLObject*>::iterator m_pos_##proper; \
+ public: \
+ xmltooling::XMLObject* get##proper() const { \
+ return m_##proper; \
+ } \
+ void set##proper(xmltooling::XMLObject* child) { \
+ prepareForAssignment(m_##proper,child); \
+ *m_pos_##proper = m_##proper = child; \
+ }
+
+/**
+ * Declares abstract get/set methods for a typed XML child collection.
+ *
+ * @param proper the proper name of the child type
+ */
+#define DECL_TYPED_CHILDREN(proper) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
+ virtual VectorOf(proper) get##proper##s()=0; \
+ XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
+ virtual const std::vector<proper*>& get##proper##s() const=0
+
+/**
+ * Declares abstract get/set methods for a typed XML child collection in a foreign namespace.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ */
+#define DECL_TYPED_FOREIGN_CHILDREN(proper,ns) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
+ virtual VectorOf(ns::proper) get##proper##s()=0; \
+ XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
+ virtual const std::vector<ns::proper*>& get##proper##s() const=0
+
+/**
+ * Declares abstract get/set methods for a generic XML child collection.
+ *
+ * @param proper the proper name of the child
+ */
+#define DECL_XMLOBJECT_CHILDREN(proper) \
+ public: \
+ XMLTOOLING_DOXYGEN(Returns modifiable proper collection.) \
+ virtual VectorOf(xmltooling::XMLObject) get##proper##s()=0; \
+ XMLTOOLING_DOXYGEN(Returns reference to immutable proper collection.) \
+ virtual const std::vector<xmltooling::XMLObject*>& get##proper##s() const=0
+
+/**
+ * Implements get method and a private vector member for a typed XML child collection.
+ *
+ * @param proper the proper name of the child type
+ * @param fence insertion fence for new objects of the child collection in backing list
+ */
+#define IMPL_TYPED_CHILDREN(proper,fence) \
+ protected: \
+ std::vector<proper*> m_##proper##s; \
+ public: \
+ VectorOf(proper) get##proper##s() { \
+ return VectorOf(proper)(this, m_##proper##s, &m_children, fence); \
+ } \
+ const std::vector<proper*>& get##proper##s() const { \
+ return m_##proper##s; \
+ }
+
+/**
+ * Implements get method and a private vector member for a typed XML child collection
+ * in a foreign namespace.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ * @param fence insertion fence for new objects of the child collection in backing list
+ */
+#define IMPL_TYPED_FOREIGN_CHILDREN(proper,ns,fence) \
+ protected: \
+ std::vector<ns::proper*> m_##proper##s; \
+ public: \
+ VectorOf(ns::proper) get##proper##s() { \
+ return VectorOf(ns::proper)(this, m_##proper##s, &m_children, fence); \
+ } \
+ const std::vector<ns::proper*>& get##proper##s() const { \
+ return m_##proper##s; \
+ }
+
+/**
+ * Implements get method and a private vector member for a generic XML child collection.
+ *
+ * @param proper the proper name of the child
+ * @param fence insertion fence for new objects of the child collection in backing list
+ */
+#define IMPL_XMLOBJECT_CHILDREN(proper,fence) \
+ protected: \
+ std::vector<xmltooling::XMLObject*> m_##proper##s; \
+ public: \
+ VectorOf(xmltooling::XMLObject) get##proper##s() { \
+ return VectorOf(xmltooling::XMLObject)(this, m_##proper##s, &m_children, fence); \
+ } \
+ const std::vector<xmltooling::XMLObject*>& get##proper##s() const { \
+ return m_##proper##s; \
+ }
+
+/**
+ * Implements marshalling for a string attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_STRING_ATTRIB(proper,ucase,namespaceURI) \
+ if (m_##proper && *m_##proper) { \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
+ }
+
+/**
+ * Implements marshalling for a DateTime attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_DATETIME_ATTRIB(proper,ucase,namespaceURI) \
+ if (m_##proper) { \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper->getRawData()); \
+ }
+
+/**
+ * Implements marshalling for an integer attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
+ if (m_##proper && *m_##proper) { \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
+ }
+
+/**
+ * Implements marshalling for a boolean attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
+ switch (m_##proper) { \
+ case xmlconstants::XML_BOOL_TRUE: \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_TRUE); \
+ break; \
+ case xmlconstants::XML_BOOL_ONE: \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ONE); \
+ break; \
+ case xmlconstants::XML_BOOL_FALSE: \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_FALSE); \
+ break; \
+ case xmlconstants::XML_BOOL_ZERO: \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, xmlconstants::XML_ZERO); \
+ break; \
+ case xmlconstants::XML_BOOL_NULL: \
+ break; \
+ }
+
+/**
+ * Implements marshalling for a QName attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_QNAME_ATTRIB(proper,ucase,namespaceURI) \
+ if (m_##proper) { \
+ auto_ptr_XMLCh qstr(m_##proper->toString().c_str()); \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, qstr.get()); \
+ }
+
+/**
+ * Implements marshalling for an ID attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define MARSHALL_ID_ATTRIB(proper,ucase,namespaceURI) \
+ if (m_##proper && *m_##proper) { \
+ domElement->setAttributeNS(namespaceURI, ucase##_ATTRIB_NAME, m_##proper); \
+ domElement->setIdAttributeNS(namespaceURI, ucase##_ATTRIB_NAME); \
+ }
+
+/**
+ * Implements unmarshalling process branch for a string attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_STRING_ATTRIB(proper,ucase,namespaceURI) \
+ if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
+ set##proper(attribute->getValue()); \
+ return; \
+ }
+
+/**
+ * Implements unmarshalling process branch for an ID attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_ID_ATTRIB(proper,ucase,namespaceURI) \
+ if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
+ set##proper(attribute->getValue()); \
+ attribute->getOwnerElement()->setIdAttributeNode(attribute); \
+ return; \
+ }
+
+/**
+ * Implements unmarshalling process branch for a DateTime attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_DATETIME_ATTRIB(proper,ucase,namespaceURI) \
+ PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
+
+/**
+ * Implements unmarshalling process branch for a DateTime attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_QNAME_ATTRIB(proper,ucase,namespaceURI) \
+ if (xmltooling::XMLHelper::isNodeNamed(attribute, namespaceURI, ucase##_ATTRIB_NAME)) { \
+ set##proper(XMLHelper::getAttributeValueAsQName(attribute)); \
+ return; \
+ }
+
+/**
+ * Implements unmarshalling process branch for an integer attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_INTEGER_ATTRIB(proper,ucase,namespaceURI) \
+ PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
+
+/**
+ * Implements unmarshalling process branch for a boolean attribute
+ *
+ * @param proper the proper name of the attribute
+ * @param ucase the upcased name of the attribute
+ * @param namespaceURI the XML namespace of the attribute
+ */
+#define PROC_BOOLEAN_ATTRIB(proper,ucase,namespaceURI) \
+ PROC_STRING_ATTRIB(proper,ucase,namespaceURI)
+
+/**
+ * Implements unmarshalling process branch for typed child collection element
+ *
+ * @param proper the proper name of the child type
+ * @param namespaceURI the XML namespace of the child element
+ * @param force bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_CHILDREN(proper,namespaceURI,force) \
+ if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
+ proper* typesafe=dynamic_cast<proper*>(childXMLObject); \
+ if (typesafe) { \
+ get##proper##s().push_back(typesafe); \
+ return; \
+ } \
+ }
+
+/**
+ * Implements unmarshalling process branch for typed child collection element
+ * in a foreign namespace.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ * @param namespaceURI the XML namespace of the child element
+ * @param force bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_FOREIGN_CHILDREN(proper,ns,namespaceURI,force) \
+ if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
+ ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
+ if (typesafe) { \
+ get##proper##s().push_back(typesafe); \
+ return; \
+ } \
+ }
+
+/**
+ * Implements unmarshalling process branch for typed child singleton element
+ *
+ * @param proper the proper name of the child type
+ * @param namespaceURI the XML namespace of the child element
+ * @param force bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_CHILD(proper,namespaceURI,force) \
+ if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
+ proper* typesafe=dynamic_cast<proper*>(childXMLObject); \
+ if (typesafe && !m_##proper) { \
+ typesafe->setParent(this); \
+ *m_pos_##proper = m_##proper = typesafe; \
+ return; \
+ } \
+ }
+
+/**
+ * Implements unmarshalling process branch for typed child singleton element
+ * in a foreign namespace.
+ *
+ * @param proper the proper name of the child type
+ * @param ns the C++ namespace for the type
+ * @param namespaceURI the XML namespace of the child element
+ * @param force bypass use of hint and just cast down to check child
+ */
+#define PROC_TYPED_FOREIGN_CHILD(proper,ns,namespaceURI,force) \
+ if (force || xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,ns::proper::LOCAL_NAME)) { \
+ ns::proper* typesafe=dynamic_cast<ns::proper*>(childXMLObject); \
+ if (typesafe && !m_##proper) { \
+ typesafe->setParent(this); \
+ *m_pos_##proper = m_##proper = typesafe; \
+ return; \
+ } \
+ }
+
+/**
+ * Implements unmarshalling process branch for a generic child singleton element
+ *
+ * @param proper the proper name of the child type
+ * @param namespaceURI the XML namespace of the child element
+ */
+#define PROC_XMLOBJECT_CHILD(proper,namespaceURI) \
+ if (xmltooling::XMLHelper::isNodeNamed(root,namespaceURI,proper::LOCAL_NAME)) { \
+ if (!m_##proper) { \
+ childXMLObject->setParent(this); \
+ *m_pos_##proper = m_##proper = childXMLObject; \
+ return; \
+ } \
+ }
+
+/**
+ * Declares aliased get/set methods for named XML element simple content.
+ *
+ * @param proper the proper name to label the element's content
+ */
+#define DECL_SIMPLE_CONTENT(proper) \
+ XMLTOOLING_DOXYGEN(Returns proper.) \
+ const XMLCh* get##proper() const { \
+ return getTextContent(); \
+ } \
+ XMLTOOLING_DOXYGEN(Sets or clears proper.) \
+ void set##proper(const XMLCh* proper) { \
+ setTextContent(proper); \
+ }
+
+/**
+ * Declares aliased get/set methods for named integer XML element content.
+ *
+ * @param proper the proper name to label the element's content
+ */
+#define DECL_INTEGER_CONTENT(proper) \
+ XMLTOOLING_DOXYGEN(Returns proper in integer form after a NULL indicator.) \
+ std::pair<bool,int> get##proper() const { \
+ return std::make_pair((getTextContent()!=NULL), (getTextContent()!=NULL ? xercesc::XMLString::parseInt(getTextContent()) : 0)); \
+ } \
+ XMLTOOLING_DOXYGEN(Sets proper.) \
+ void set##proper(int proper) { \
+ char buf[64]; \
+ sprintf(buf,"%d",proper); \
+ xmltooling::auto_ptr_XMLCh widebuf(buf); \
+ setTextContent(widebuf.get()); \
+ } \
+ XMLTOOLING_DOXYGEN(Sets or clears proper.) \
+ void set##proper(const XMLCh* proper) { \
+ setTextContent(proper); \
+ }
+
+/**
+ * Implements cloning methods for an XMLObject specialization implementation class.
+ *
+ * @param cname the name of the XMLObject specialization
+ */
+#define IMPL_XMLOBJECT_CLONE(cname) \
+ cname* clone##cname() const { \
+ return dynamic_cast<cname*>(clone()); \
+ } \
+ xmltooling::XMLObject* clone() const { \
+ std::auto_ptr<xmltooling::XMLObject> domClone(xmltooling::AbstractDOMCachingXMLObject::clone()); \
+ cname##Impl* ret=dynamic_cast<cname##Impl*>(domClone.get()); \
+ if (ret) { \
+ domClone.release(); \
+ return ret; \
+ } \
+ return new cname##Impl(*this); \
+ }
+
+/**
+ * Declares an XMLObject specialization with a simple content model and type,
+ * handling it as string data.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ * @param proper the proper name to label the element's content
+ * @param desc documentation for class
+ */
+#define DECL_XMLOBJECT_SIMPLE(linkage,cname,proper,desc) \
+ BEGIN_XMLOBJECT(linkage,cname,xmltooling::XMLObject,desc); \
+ DECL_SIMPLE_CONTENT(proper); \
+ END_XMLOBJECT
+
+/**
+ * Declares and defines an implementation class for an XMLObject with
+ * a simple content model and type, handling it as string data.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ */
+#define DECL_XMLOBJECTIMPL_SIMPLE(linkage,cname) \
+ class linkage cname##Impl \
+ : public virtual cname, \
+ public xmltooling::AbstractSimpleElement, \
+ public xmltooling::AbstractDOMCachingXMLObject, \
+ public xmltooling::AbstractXMLObjectMarshaller, \
+ public xmltooling::AbstractXMLObjectUnmarshaller \
+ { \
+ public: \
+ virtual ~cname##Impl() {} \
+ cname##Impl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) \
+ : xmltooling::AbstractXMLObject(nsURI, localName, prefix, schemaType) { \
+ } \
+ cname##Impl(const cname##Impl& src) \
+ : xmltooling::AbstractXMLObject(src), \
+ xmltooling::AbstractSimpleElement(src), \
+ xmltooling::AbstractDOMCachingXMLObject(src) {} \
+ IMPL_XMLOBJECT_CLONE(cname) \
+ }
+
+#ifdef HAVE_COVARIANT_RETURNS
+
+/**
+ * Begins the declaration of an XMLObjectBuilder specialization.
+ * Basic boilerplate includes an empty virtual destructor, and
+ * a default builder that defaults the element name.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+#define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
+ XMLTOOLING_DOXYGEN(Builder for cname objects.) \
+ class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \
+ public: \
+ virtual ~cname##Builder() {} \
+ XMLTOOLING_DOXYGEN(Default builder.) \
+ virtual cname* buildObject() const { \
+ return buildObject(namespaceURI,cname::LOCAL_NAME,namespacePrefix); \
+ } \
+ XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \
+ virtual cname* buildObject( \
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \
+ ) const
+
+/**
+ * Ends the declaration of an XMLObjectBuilder specialization.
+ */
+#define END_XMLOBJECTBUILDER }
+
+/**
+ * Declares a generic XMLObjectBuilder specialization.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+ #define DECL_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
+ BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix); \
+ XMLTOOLING_DOXYGEN(Singleton builder.) \
+ static cname* build##cname() { \
+ const cname##Builder* b = dynamic_cast<const cname##Builder*>( \
+ XMLObjectBuilder::getBuilder(xmltooling::QName(namespaceURI,cname::LOCAL_NAME)) \
+ ); \
+ if (b) \
+ return b->buildObject(); \
+ throw xmltooling::XMLObjectException("Unable to obtain typed builder for "#cname"."); \
+ } \
+ END_XMLOBJECTBUILDER
+
+/**
+ * Implements the standard XMLObjectBuilder specialization function.
+ *
+ * @param cname the name of the XMLObject specialization
+ */
+#define IMPL_XMLOBJECTBUILDER(cname) \
+ cname* cname##Builder::buildObject( \
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \
+ ) const \
+ { \
+ return new cname##Impl(nsURI,localName,prefix,schemaType); \
+ }
+
+#else /* !HAVE_COVARIANT_RETURNS */
+
+/**
+ * Begins the declaration of an XMLObjectBuilder specialization.
+ * Basic boilerplate includes an empty virtual destructor, and
+ * a default builder that defaults the element name.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+#define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
+ XMLTOOLING_DOXYGEN(Builder for cname objects.) \
+ class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \
+ public: \
+ virtual ~cname##Builder() {} \
+ XMLTOOLING_DOXYGEN(Default builder.) \
+ virtual xmltooling::XMLObject* buildObject() const { \
+ return buildObject(namespaceURI,cname::LOCAL_NAME,namespacePrefix); \
+ } \
+ XMLTOOLING_DOXYGEN(Builder that allows element/type override.) \
+ virtual xmltooling::XMLObject* buildObject( \
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL \
+ ) const
+
+/**
+ * Ends the declaration of an XMLObjectBuilder specialization.
+ */
+#define END_XMLOBJECTBUILDER }
+
+/**
+ * Declares a generic XMLObjectBuilder specialization.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ * @param namespaceURI the XML namespace of the default associated element
+ * @param namespacePrefix the XML namespace prefix of the default associated element
+ */
+ #define DECL_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \
+ BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix); \
+ XMLTOOLING_DOXYGEN(Singleton builder.) \
+ static cname* build##cname() { \
+ const cname##Builder* b = dynamic_cast<const cname##Builder*>( \
+ XMLObjectBuilder::getBuilder(xmltooling::QName(namespaceURI,cname::LOCAL_NAME)) \
+ ); \
+ if (b) \
+ return dynamic_cast<cname*>(b->buildObject()); \
+ throw xmltooling::XMLObjectException("Unable to obtain typed builder for "#cname"."); \
+ } \
+ END_XMLOBJECTBUILDER
+
+/**
+ * Implements the standard XMLObjectBuilder specialization function.
+ *
+ * @param cname the name of the XMLObject specialization
+ */
+#define IMPL_XMLOBJECTBUILDER(cname) \
+ xmltooling::XMLObject* cname##Builder::buildObject( \
+ const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType \
+ ) const \
+ { \
+ return new cname##Impl(nsURI,localName,prefix,schemaType); \
+ }
+
+#endif /* HAVE_COVARIANT_RETURNS */
+
+/**
+ * Begins the declaration of a Schema Validator specialization.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the base name of the Validator specialization
+ */
+ #define BEGIN_XMLOBJECTVALIDATOR(linkage,cname) \
+ class linkage cname##SchemaValidator : public xmltooling::Validator \
+ { \
+ public: \
+ virtual ~cname##SchemaValidator() {} \
+ virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
+ const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
+ if (!ptr) \
+ throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name())); \
+ if (ptr->nil() && (ptr->hasChildren() || ptr->getTextContent())) \
+ throw xmltooling::ValidationException("Object has nil property but with children or content.")
+
+/**
+ * Begins the declaration of a Schema Validator specialization subclass.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the base name of the Validator specialization
+ * @param base base class for the validator
+ */
+ #define BEGIN_XMLOBJECTVALIDATOR_SUB(linkage,cname,base) \
+ class linkage cname##SchemaValidator : public base##SchemaValidator \
+ { \
+ public: \
+ virtual ~cname##SchemaValidator() {} \
+ virtual void validate(const xmltooling::XMLObject* xmlObject) const { \
+ const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
+ if (!ptr) \
+ throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name()));
+
+/**
+ * Ends the declaration of a Validator specialization.
+ */
+#define END_XMLOBJECTVALIDATOR } }
+
+/**
+ * Validator code that checks the object type.
+ *
+ * @param cname the name of the XMLObject specialization
+ */
+#define XMLOBJECTVALIDATOR_CHECKTYPE(cname) \
+ const cname* ptr=dynamic_cast<const cname*>(xmlObject); \
+ if (!ptr) \
+ throw xmltooling::ValidationException(#cname"SchemaValidator: unsupported object type ($1).",xmltooling::params(1,typeid(xmlObject).name()))
+
+/**
+ * Validator code that checks for a required attribute, content, or singleton.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper the proper name of the attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_REQUIRE(cname,proper) \
+ if (!ptr->get##proper()) \
+ throw xmltooling::ValidationException(#cname" must have "#proper".")
+
+/**
+ * Validator code that checks for a required integer attribute
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper the proper name of the attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_REQUIRE_INTEGER(cname,proper) \
+ if (!ptr->get##proper().first) \
+ throw xmltooling::ValidationException(#cname" must have "#proper".")
+
+/**
+ * Validator code that checks for one of a pair of
+ * required attributes, content, or singletons.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper1 the proper name of the first attribute, content, or singleton member
+ * @param proper2 the proper name of the second attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_ONEOF(cname,proper1,proper2) \
+ if (!ptr->get##proper1() && !ptr->get##proper2()) \
+ throw xmltooling::ValidationException(#cname" must have "#proper1" or "#proper2".")
+
+/**
+ * Validator code that checks for one of a pair of
+ * required attributes, content, or singletons, but disallows both.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper1 the proper name of the first attribute, content, or singleton member
+ * @param proper2 the proper name of the second attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_ONLYONEOF(cname,proper1,proper2) \
+ if ((!ptr->get##proper1() && !ptr->get##proper2()) || (ptr->get##proper1() && ptr->get##proper2())) \
+ throw xmltooling::ValidationException(#cname" must have "#proper1" or "#proper2" but not both.")
+
+/**
+ * Validator code that checks for one of a set of three
+ * required attributes, content, or singletons.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper1 the proper name of the first attribute, content, or singleton member
+ * @param proper2 the proper name of the second attribute, content, or singleton member
+ * @param proper3 the proper name of the third attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_ONEOF3(cname,proper1,proper2,proper3) \
+ if (!ptr->get##proper1() && !ptr->get##proper2() && !ptr->get##proper3()) \
+ throw xmltooling::ValidationException(#cname" must have "#proper1", "#proper2", or "#proper3".")
+
+/**
+ * Validator code that checks for one of a set of three
+ * required attributes, content, or singletons but disallows more than one.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper1 the proper name of the first attribute, content, or singleton member
+ * @param proper2 the proper name of the second attribute, content, or singleton member
+ * @param proper3 the proper name of the third attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_ONLYONEOF3(cname,proper1,proper2,proper3) \
+ int c##proper1##proper2##proper3=0; \
+ if (ptr->get##proper1()!=NULL) \
+ c##proper1##proper2##proper3++; \
+ if (ptr->get##proper2()!=NULL) \
+ c##proper1##proper2##proper3++; \
+ if (ptr->get##proper3()!=NULL) \
+ c##proper1##proper2##proper3++; \
+ if (c##proper1##proper2##proper3 != 1) \
+ throw xmltooling::ValidationException(#cname" must have only one of "#proper1", "#proper2", or "#proper3".")
+
+/**
+ * Validator code that checks a co-constraint (if one present, the other must be)
+ * between a pair of attributes, content, or singletons.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper1 the proper name of the first attribute, content, or singleton member
+ * @param proper2 the proper name of the second attribute, content, or singleton member
+ */
+#define XMLOBJECTVALIDATOR_NONEORBOTH(cname,proper1,proper2) \
+ if ((ptr->get##proper1() && !ptr->get##proper2()) || (!ptr->get##proper1() && ptr->get##proper2())) \
+ throw xmltooling::ValidationException(#cname" cannot have "#proper1" without "#proper2".")
+
+/**
+ * Validator code that checks for a non-empty collection.
+ *
+ * @param cname the name of the XMLObject specialization
+ * @param proper the proper name of the collection item
+ */
+#define XMLOBJECTVALIDATOR_NONEMPTY(cname,proper) \
+ if (ptr->get##proper##s().empty()) \
+ throw xmltooling::ValidationException(#cname" must have at least one "#proper".")
+
+/**
+ * Declares/defines a Validator specialization that checks object type and
+ * a non-empty simple content model.
+ *
+ * @param linkage linkage specifier for the class
+ * @param cname the name of the XMLObject specialization
+ */
+#define XMLOBJECTVALIDATOR_SIMPLE(linkage,cname) \
+ BEGIN_XMLOBJECTVALIDATOR(linkage,cname); \
+ XMLOBJECTVALIDATOR_REQUIRE(cname,TextContent); \
+ END_XMLOBJECTVALIDATOR
+
+#include <utility>
+
+/**
+ * @namespace xmltooling
+ * Public namespace of XML Tooling library
+ */
+namespace xmltooling {
+
+ /**
+ * Template function for cloning a sequence of XMLObjects.
+ * Invokes the clone() member on each element of the input sequence and adds the copy to
+ * the output sequence. Order is preserved.
+ *
+ * @param in input sequence to clone
+ * @param out output sequence to copy cloned pointers into
+ */
+ template<class InputSequence,class OutputSequence> void clone(const InputSequence& in, OutputSequence& out) {
+ for (typename InputSequence::const_iterator i=in.begin(); i!=in.end(); i++) {
+ if (*i)
+ out.push_back((*i)->clone());
+ else
+ out.push_back(*i);
+ }
+ }
+
+ /**
+ * Functor for cleaning up heap objects in containers.
+ */
+ template<class T> struct cleanup
+ {
+ /**
+ * Function operator to delete an object.
+ *
+ * @param ptr object to delete
+ */
+ void operator()(T* ptr) {delete ptr;}
+
+ /**
+ * Function operator to delete an object stored as const.
+ *
+ * @param ptr object to delete after casting away const
+ */
+ void operator()(const T* ptr) {delete const_cast<T*>(ptr);}
+ };
+
+ /**
+ * Functor for cleaning up heap objects in key/value containers.
+ */
+ template<class A,class B> struct cleanup_pair
+ {
+ /**
+ * Function operator to delete an object.
+ *
+ * @param p a pair in which the second component is the object to delete
+ */
+ void operator()(const std::pair<const A,B*>& p) {delete p.second;}
+ };
+
+ /**
+ * Functor for cleaning up const heap objects in key/value containers.
+ */
+ template<class A,class B> struct cleanup_const_pair
+ {
+ /**
+ * Function operator to delete an object stored as const
+ *
+ * @param p a pair in which the second component is the const object to delete
+ */
+ void operator()(const std::pair<const A,const B*>& p) {delete const_cast<B*>(p.second);}
+ };
+};
+
+#endif /* __xmltooling_base_h__ */
diff --git a/xmltooling/exceptions.cpp b/xmltooling/exceptions.cpp
index 4b15451..1d0e883 100644
--- a/xmltooling/exceptions.cpp
+++ b/xmltooling/exceptions.cpp
@@ -1,314 +1,315 @@
-/*
- * Copyright 2001-2007 Internet2
- *
- * 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.
- */
-
-/**
- * exceptions.cpp
- *
- * Exception classes
- */
-
-#include "internal.h"
-#include "exceptions.h"
-#include "XMLToolingConfig.h"
-#include "util/URLEncoder.h"
-#include "util/XMLConstants.h"
-#include "util/XMLHelper.h"
-
-#include <stdarg.h>
-#include <sstream>
-#include <xercesc/util/XMLUniDefs.hpp>
-
-using namespace xmltooling;
-using namespace std;
-using xmlconstants::XMLTOOLING_NS;
-
-params::params(int count,...)
-{
- va_list args;
- va_start(args,count);
- while (count--)
- v.push_back(va_arg(args,char*));
- va_end(args);
-}
-
-namedparams::namedparams(int count,...)
-{
- count*=2;
- va_list args;
- va_start(args,count);
- while (count--)
- v.push_back(va_arg(args,char*));
- va_end(args);
-}
-
-XMLToolingException::ExceptionFactoryMap XMLToolingException::m_factoryMap;
-
-XMLToolingException* XMLToolingException::getInstance(const char* exceptionClass)
-{
- if (exceptionClass) {
- ExceptionFactoryMap::const_iterator i=m_factoryMap.find(exceptionClass);
- if (i!=m_factoryMap.end())
- return (i->second)();
- }
- return new XMLToolingException();
-}
-
-XMLToolingException::XMLToolingException(const char* msg, const params& p)
-{
- if (msg)
- m_msg=msg;
- addProperties(p);
-}
-
-XMLToolingException::XMLToolingException(const char* msg, const namedparams& p)
-{
- if (msg)
- m_msg=msg;
- addProperties(p);
-}
-
-XMLToolingException::XMLToolingException(const std::string& msg, const params& p) : m_msg(msg)
-{
- addProperties(p);
-}
-
-XMLToolingException::XMLToolingException(const std::string& msg, const namedparams& p) : m_msg(msg)
-{
- addProperties(p);
-}
-
-void XMLToolingException::setMessage(const char* msg)
-{
- if (msg)
- m_msg=msg;
- else
- m_msg.erase();
- m_processedmsg.erase();
-}
-
-inline const char* get_digit_character()
-{
- static const char s_characters[19] =
- {
- '9'
- , '8'
- , '7'
- , '6'
- , '5'
- , '4'
- , '3'
- , '2'
- , '1'
- , '0'
- , '1'
- , '2'
- , '3'
- , '4'
- , '5'
- , '6'
- , '7'
- , '8'
- , '9'
- };
- static const char *s_mid = s_characters + 9;
-
- return s_mid;
-}
-
-inline const char* unsigned_integer_to_string(char* buf, size_t cchBuf, int i)
-{
- char* psz=buf + cchBuf - 1; // Set psz to last char
- *psz = 0; // Set terminating null
-
- do {
- unsigned int lsd = i % 10; // Get least significant
- // digit
-
- i /= 10; // Prepare for next most
- // significant digit
-
- --psz; // Move back
-
- *psz = get_digit_character()[lsd]; // Place the digit
-
- } while(i!=0 && psz>buf);
-
- return psz;
-}
-
-void XMLToolingException::addProperties(const params& p)
-{
- m_processedmsg.erase();
- int i=m_params.size()+1;
- char buf[20];
- const vector<const char*>& v=p.get();
- for (vector<const char*>::const_iterator ci=v.begin(); ci!=v.end(); ci++) {
- m_params[unsigned_integer_to_string(buf,sizeof(buf),i++)] = *ci;
- }
-}
-
-void XMLToolingException::addProperties(const namedparams& p)
-{
- m_processedmsg.erase();
- const vector<const char*>& v=p.get();
- for (vector<const char*>::const_iterator ci=v.begin(); ci!=v.end(); ci++) {
- m_params.erase(*ci);
- m_params[*ci] = *(ci+1);
- ci++; // advance past name to value, then loop will advance it again
- }
-}
-
-const char* XMLToolingException::getProperty(unsigned int index) const
-{
- char buf[20];
- map<string,string>::const_iterator i=m_params.find(unsigned_integer_to_string(buf,sizeof(buf),index));
- return (i==m_params.end()) ? NULL : i->second.c_str();
-}
-
-const char* XMLToolingException::getProperty(const char* name) const
-{
- map<string,string>::const_iterator i=m_params.find(name);
- return (i==m_params.end()) ? NULL : i->second.c_str();
-}
-
-const char* XMLToolingException::getMessage() const
-{
- if (!m_processedmsg.empty())
- return m_processedmsg.c_str();
- else if (m_params.empty())
- return m_msg.c_str();
-
- static const char* legal="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_";
-
- // Replace any parameters in the message.
- string::size_type i=0,start=0;
- while (start!=string::npos && start<m_msg.length() && (i=m_msg.find("$",start))!=string::npos) {
- if (i>start)
- m_processedmsg += m_msg.substr(start,i-start); // append everything in between
- start=i+1; // move start to the beginning of the token name
- i=m_msg.find_first_not_of(legal,start); // find token delimiter
- if (i==start) { // append a non legal character
- m_processedmsg+=m_msg[start++];
- continue;
- }
-
- // search for token in map
- map<string,string>::const_iterator param=m_params.find(m_msg.substr(start,(i==string::npos) ? i : i-start));
- if (param!=m_params.end()) {
- m_processedmsg+=param->second;
- start=i;
- }
- }
- if (start!=string::npos && start<m_msg.length())
- m_processedmsg += m_msg.substr(start,i); // append rest of string
- return m_processedmsg.c_str();
-}
-
-void xml_encode(string& s, const char* pre, const char* start, const char* post)
-{
- s += pre;
- size_t pos;
- while (start && *start) {
- pos = strcspn(start, "\"<>&");
- if (pos > 0) {
- s.append(start, pos);
- start += pos;
- }
- else {
- switch (*start) {
- case '\'': s += "'"; break;
- case '<': s += "<"; break;
- case '>': s += ">"; break;
- case '&': s += "&"; break;
- default: s += *start;
- }
- start++;
- }
- }
- s += post;
-}
-
-string XMLToolingException::toString() const
-{
- string xml=string("<exception xmlns='http://www.opensaml.org/xmltooling' type='") + getClassName() + "'>";
- const char* msg=getMessage();
- if (msg)
- xml_encode(xml, "<message>", msg, "</message>");
- for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
- xml_encode(xml, "<param name='", i->first.c_str(), "'");
- xml_encode(xml, ">", i->second.c_str(), "</param>");
- }
- xml+="</exception>";
- return xml;
-}
-
-string XMLToolingException::toQueryString() const
-{
- string q;
- const URLEncoder* enc = XMLToolingConfig::getConfig().getURLEncoder();
- for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
- if (!q.empty())
- q += '&';
- q = q + i->first + '=' + enc->encode(i->second.c_str());
- }
- return q;
-}
-
-XMLToolingException* XMLToolingException::fromStream(std::istream& in)
-{
- static const XMLCh exception[] = UNICODE_LITERAL_9(e,x,c,e,p,t,i,o,n);
- static const XMLCh message[] = UNICODE_LITERAL_7(m,e,s,s,a,g,e);
- static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e);
- static const XMLCh param[] = UNICODE_LITERAL_5(p,a,r,a,m);
- static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e);
-
- DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
-
- // Check root element.
- const DOMElement* root=doc->getDocumentElement();
- if (!XMLHelper::isNodeNamed(root,XMLTOOLING_NS,exception)) {
- doc->release();
- throw XMLToolingException("Invalid root element on serialized exception.");
- }
-
- auto_ptr_char classname(root->getAttributeNS(NULL,type));
- auto_ptr<XMLToolingException> excep(XMLToolingException::getInstance(classname.get()));
-
- DOMElement* child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,message);
- if (child && child->hasChildNodes()) {
- auto_ptr_char m(child->getFirstChild()->getNodeValue());
- excep->setMessage(m.get());
- }
-
- child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param);
- while (child && child->hasChildNodes()) {
- auto_ptr_char n(child->getAttributeNS(NULL,name));
- char* v=toUTF8(child->getFirstChild()->getNodeValue());
- if (n.get() && v)
- excep->addProperty(n.get(), v);
- delete[] v;
- child=XMLHelper::getNextSiblingElement(child,XMLTOOLING_NS,param);
- }
-
- doc->release();
- return excep.release();
-}
-
-XMLToolingException* XMLToolingException::fromString(const char* s)
-{
- istringstream in(s);
- return fromStream(in);
-}
+/*
+ * Copyright 2001-2007 Internet2
+ *
+ * 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.
+ */
+
+/**
+ * exceptions.cpp
+ *
+ * Exception classes
+ */
+
+#include "internal.h"
+#include "exceptions.h"
+#include "XMLToolingConfig.h"
+#include "util/URLEncoder.h"
+#include "util/XMLConstants.h"
+#include "util/XMLHelper.h"
+
+#include <stdarg.h>
+#include <memory>
+#include <sstream>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+using namespace xmltooling;
+using namespace std;
+using xmlconstants::XMLTOOLING_NS;
+
+params::params(int count,...)
+{
+ va_list args;
+ va_start(args,count);
+ while (count--)
+ v.push_back(va_arg(args,char*));
+ va_end(args);
+}
+
+namedparams::namedparams(int count,...)
+{
+ count*=2;
+ va_list args;
+ va_start(args,count);
+ while (count--)
+ v.push_back(va_arg(args,char*));
+ va_end(args);
+}
+
+XMLToolingException::ExceptionFactoryMap XMLToolingException::m_factoryMap;
+
+XMLToolingException* XMLToolingException::getInstance(const char* exceptionClass)
+{
+ if (exceptionClass) {
+ ExceptionFactoryMap::const_iterator i=m_factoryMap.find(exceptionClass);
+ if (i!=m_factoryMap.end())
+ return (i->second)();
+ }
+ return new XMLToolingException();
+}
+
+XMLToolingException::XMLToolingException(const char* msg, const params& p)
+{
+ if (msg)
+ m_msg=msg;
+ addProperties(p);
+}
+
+XMLToolingException::XMLToolingException(const char* msg, const namedparams& p)
+{
+ if (msg)
+ m_msg=msg;
+ addProperties(p);
+}
+
+XMLToolingException::XMLToolingException(const std::string& msg, const params& p) : m_msg(msg)
+{
+ addProperties(p);
+}
+
+XMLToolingException::XMLToolingException(const std::string& msg, const namedparams& p) : m_msg(msg)
+{
+ addProperties(p);
+}
+
+void XMLToolingException::setMessage(const char* msg)
+{
+ if (msg)
+ m_msg=msg;
+ else
+ m_msg.erase();
+ m_processedmsg.erase();
+}
+
+inline const char* get_digit_character()
+{
+ static const char s_characters[19] =
+ {
+ '9'
+ , '8'
+ , '7'
+ , '6'
+ , '5'
+ , '4'
+ , '3'
+ , '2'
+ , '1'
+ , '0'
+ , '1'
+ , '2'
+ , '3'
+ , '4'
+ , '5'
+ , '6'
+ , '7'
+ , '8'
+ , '9'
+ };
+ static const char *s_mid = s_characters + 9;
+
+ return s_mid;
+}
+
+inline const char* unsigned_integer_to_string(char* buf, size_t cchBuf, int i)
+{
+ char* psz=buf + cchBuf - 1; // Set psz to last char
+ *psz = 0; // Set terminating null
+
+ do {
+ unsigned int lsd = i % 10; // Get least significant
+ // digit
+
+ i /= 10; // Prepare for next most
+ // significant digit
+
+ --psz; // Move back
+
+ *psz = get_digit_character()[lsd]; // Place the digit
+
+ } while(i!=0 && psz>buf);
+
+ return psz;
+}
+
+void XMLToolingException::addProperties(const params& p)
+{
+ m_processedmsg.erase();
+ int i=m_params.size()+1;
+ char buf[20];
+ const vector<const char*>& v=p.get();
+ for (vector<const char*>::const_iterator ci=v.begin(); ci!=v.end(); ci++) {
+ m_params[unsigned_integer_to_string(buf,sizeof(buf),i++)] = *ci;
+ }
+}
+
+void XMLToolingException::addProperties(const namedparams& p)
+{
+ m_processedmsg.erase();
+ const vector<const char*>& v=p.get();
+ for (vector<const char*>::const_iterator ci=v.begin(); ci!=v.end(); ci++) {
+ m_params.erase(*ci);
+ m_params[*ci] = *(ci+1);
+ ci++; // advance past name to value, then loop will advance it again
+ }
+}
+
+const char* XMLToolingException::getProperty(unsigned int index) const
+{
+ char buf[20];
+ map<string,string>::const_iterator i=m_params.find(unsigned_integer_to_string(buf,sizeof(buf),index));
+ return (i==m_params.end()) ? NULL : i->second.c_str();
+}
+
+const char* XMLToolingException::getProperty(const char* name) const
+{
+ map<string,string>::const_iterator i=m_params.find(name);
+ return (i==m_params.end()) ? NULL : i->second.c_str();
+}
+
+const char* XMLToolingException::getMessage() const
+{
+ if (!m_processedmsg.empty())
+ return m_processedmsg.c_str();
+ else if (m_params.empty())
+ return m_msg.c_str();
+
+ static const char* legal="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_";
+
+ // Replace any parameters in the message.
+ string::size_type i=0,start=0;
+ while (start!=string::npos && start<m_msg.length() && (i=m_msg.find("$",start))!=string::npos) {
+ if (i>start)
+ m_processedmsg += m_msg.substr(start,i-start); // append everything in between
+ start=i+1; // move start to the beginning of the token name
+ i=m_msg.find_first_not_of(legal,start); // find token delimiter
+ if (i==start) { // append a non legal character
+ m_processedmsg+=m_msg[start++];
+ continue;
+ }
+
+ // search for token in map
+ map<string,string>::const_iterator param=m_params.find(m_msg.substr(start,(i==string::npos) ? i : i-start));
+ if (param!=m_params.end()) {
+ m_processedmsg+=param->second;
+ start=i;
+ }
+ }
+ if (start!=string::npos && start<m_msg.length())
+ m_processedmsg += m_msg.substr(start,i); // append rest of string
+ return m_processedmsg.c_str();
+}
+
+void xml_encode(string& s, const char* pre, const char* start, const char* post)
+{
+ s += pre;
+ size_t pos;
+ while (start && *start) {
+ pos = strcspn(start, "\"<>&");
+ if (pos > 0) {
+ s.append(start, pos);
+ start += pos;
+ }
+ else {
+ switch (*start) {
+ case '\'': s += "'"; break;
+ case '<': s += "<"; break;
+ case '>': s += ">"; break;
+ case '&': s += "&"; break;
+ default: s += *start;
+ }
+ start++;
+ }
+ }
+ s += post;
+}
+
+string XMLToolingException::toString() const
+{
+ string xml=string("<exception xmlns='http://www.opensaml.org/xmltooling' type='") + getClassName() + "'>";
+ const char* msg=getMessage();
+ if (msg)
+ xml_encode(xml, "<message>", msg, "</message>");
+ for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
+ xml_encode(xml, "<param name='", i->first.c_str(), "'");
+ xml_encode(xml, ">", i->second.c_str(), "</param>");
+ }
+ xml+="</exception>";
+ return xml;
+}
+
+string XMLToolingException::toQueryString() const
+{
+ string q;
+ const URLEncoder* enc = XMLToolingConfig::getConfig().getURLEncoder();
+ for (map<string,string>::const_iterator i=m_params.begin(); i!=m_params.end(); i++) {
+ if (!q.empty())
+ q += '&';
+ q = q + i->first + '=' + enc->encode(i->second.c_str());
+ }
+ return q;
+}
+
+XMLToolingException* XMLToolingException::fromStream(std::istream& in)
+{
+ static const XMLCh exception[] = UNICODE_LITERAL_9(e,x,c,e,p,t,i,o,n);
+ static const XMLCh message[] = UNICODE_LITERAL_7(m,e,s,s,a,g,e);
+ static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e);
+ static const XMLCh param[] = UNICODE_LITERAL_5(p,a,r,a,m);
+ static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e);
+
+ DOMDocument* doc=XMLToolingConfig::getConfig().getParser().parse(in);
+
+ // Check root element.
+ const DOMElement* root=doc->getDocumentElement();
+ if (!XMLHelper::isNodeNamed(root,XMLTOOLING_NS,exception)) {
+ doc->release();
+ throw XMLToolingException("Invalid root element on serialized exception.");
+ }
+
+ auto_ptr_char classname(root->getAttributeNS(NULL,type));
+ auto_ptr<XMLToolingException> excep(XMLToolingException::getInstance(classname.get()));
+
+ DOMElement* child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,message);
+ if (child && child->hasChildNodes()) {
+ auto_ptr_char m(child->getFirstChild()->getNodeValue());
+ excep->setMessage(m.get());
+ }
+
+ child=XMLHelper::getFirstChildElement(root,XMLTOOLING_NS,param);
+ while (child && child->hasChildNodes()) {
+ auto_ptr_char n(child->getAttributeNS(NULL,name));
+ char* v=toUTF8(child->getFirstChild()->getNodeValue());
+ if (n.get() && v)
+ excep->addProperty(n.get(), v);
+ delete[] v;
+ child=XMLHelper::getNextSiblingElement(child,XMLTOOLING_NS,param);
+ }
+
+ doc->release();
+ return excep.release();
+}
+
+XMLToolingException* XMLToolingException::fromString(const char* s)
+{
+ istringstream in(s);
+ return fromStream(in);
+}
diff --git a/xmltooling/impl/MemoryStorageService.cpp b/xmltooling/impl/MemoryStorageService.cpp
index af0fd71..b297d65 100644
--- a/xmltooling/impl/MemoryStorageService.cpp
+++ b/xmltooling/impl/MemoryStorageService.cpp
@@ -1,318 +1,319 @@
-/*
- * Copyright 2001-2007 Internet2
- *
- * 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.
- */
-
-/**
- * MemoryStorageService.cpp
- *
- * In-memory "persistent" storage, suitable for simple applications.
- */
-
-#include "internal.h"
-#include "logging.h"
-#include "util/NDC.h"
-#include "util/StorageService.h"
-#include "util/Threads.h"
-#include "util/XMLHelper.h"
-
-#include <xercesc/util/XMLUniDefs.hpp>
-
-using namespace xmltooling::logging;
-using namespace xmltooling;
-using namespace std;
-
-namespace xmltooling {
- class XMLTOOL_DLLLOCAL MemoryStorageService : public StorageService
- {
- public:
- MemoryStorageService(const DOMElement* e);
- virtual ~MemoryStorageService();
-
- bool createString(const char* context, const char* key, const char* value, time_t expiration);
- int readString(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0);
- int updateString(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0);
- bool deleteString(const char* context, const char* key);
-
- bool createText(const char* context, const char* key, const char* value, time_t expiration) {
- return createString(context, key, value, expiration);
- }
- int readText(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) {
- return readString(context, key, pvalue, pexpiration, version);
- }
- int updateText(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) {
- return updateString(context, key, value, expiration, version);
- }
- bool deleteText(const char* context, const char* key) {
- return deleteString(context, key);
- }
-
- void reap(const char* context);
- void updateContext(const char* context, time_t expiration);
- void deleteContext(const char* context) {
- m_lock->wrlock();
- m_contextMap.erase(context);
- m_lock->unlock();
- }
-
- private:
- void cleanup();
-
- struct XMLTOOL_DLLLOCAL Record {
- Record() : expiration(0), version(1) {}
- Record(const string& s, time_t t) : data(s), expiration(t), version(1) {}
- string data;
- time_t expiration;
- int version;
- };
-
- struct XMLTOOL_DLLLOCAL Context {
- Context() {}
- Context(const Context& src) {
- m_dataMap = src.m_dataMap;
- }
- map<string,Record> m_dataMap;
- unsigned long reap(time_t exp);
- };
-
- Context& readContext(const char* context) {
- m_lock->rdlock();
- map<string,Context>::iterator i = m_contextMap.find(context);
- if (i != m_contextMap.end())
- return i->second;
- m_lock->unlock();
- m_lock->wrlock();
- return m_contextMap[context];
- }
-
- Context& writeContext(const char* context) {
- m_lock->wrlock();
- return m_contextMap[context];
- }
-
- map<string,Context> m_contextMap;
- RWLock* m_lock;
- CondWait* shutdown_wait;
- Thread* cleanup_thread;
- static void* cleanup_fn(void*);
- bool shutdown;
- int m_cleanupInterval;
- Category& m_log;
- };
-
- StorageService* XMLTOOL_DLLLOCAL MemoryStorageServiceFactory(const DOMElement* const & e)
- {
- return new MemoryStorageService(e);
- }
-};
-
-static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l);
-
-MemoryStorageService::MemoryStorageService(const DOMElement* e)
- : m_lock(NULL), shutdown_wait(NULL), cleanup_thread(NULL), shutdown(false), m_cleanupInterval(0),
- m_log(Category::getInstance(XMLTOOLING_LOGCAT".StorageService"))
-{
- const XMLCh* tag=e ? e->getAttributeNS(NULL,cleanupInterval) : NULL;
- if (tag && *tag) {
- m_cleanupInterval = XMLString::parseInt(tag);
- }
- if (!m_cleanupInterval)
- m_cleanupInterval=900;
-
- m_lock = RWLock::create();
- shutdown_wait = CondWait::create();
- cleanup_thread = Thread::create(&cleanup_fn, (void*)this);
-}
-
-MemoryStorageService::~MemoryStorageService()
-{
- // Shut down the cleanup thread and let it know...
- shutdown = true;
- shutdown_wait->signal();
- cleanup_thread->join(NULL);
-
- delete shutdown_wait;
- delete m_lock;
-}
-
-void* MemoryStorageService::cleanup_fn(void* cache_p)
-{
- MemoryStorageService* cache = reinterpret_cast<MemoryStorageService*>(cache_p);
-
-#ifndef WIN32
- // First, let's block all signals
- Thread::mask_all_signals();
-#endif
-
- // Now run the cleanup process.
- cache->cleanup();
- return NULL;
-}
-
-void MemoryStorageService::cleanup()
-{
-#ifdef _DEBUG
- NDC ndc("cleanup");
-#endif
-
- auto_ptr<Mutex> mutex(Mutex::create());
- mutex->lock();
-
- m_log.info("cleanup thread started...running every %d seconds", m_cleanupInterval);
-
- while (!shutdown) {
- shutdown_wait->timedwait(mutex.get(), m_cleanupInterval);
- if (shutdown)
- break;
-
- unsigned long count=0;
- time_t now = time(NULL);
- m_lock->wrlock();
- SharedLock locker(m_lock, false);
- for (map<string,Context>::iterator i=m_contextMap.begin(); i!=m_contextMap.end(); ++i)
- count += i->second.reap(now);
-
- if (count)
- m_log.info("purged %d expired record(s) from storage", count);
- }
-
- m_log.info("cleanup thread finished");
-
- mutex->unlock();
- Thread::exit(NULL);
-}
-
-void MemoryStorageService::reap(const char* context)
-{
- Context& ctx = writeContext(context);
- SharedLock locker(m_lock, false);
- ctx.reap(time(NULL));
-}
-
-unsigned long MemoryStorageService::Context::reap(time_t exp)
-{
- // Garbage collect any expired entries.
- unsigned long count=0;
- map<string,Record>::iterator cur = m_dataMap.begin();
- map<string,Record>::iterator stop = m_dataMap.end();
- while (cur != stop) {
- if (cur->second.expiration <= exp) {
- map<string,Record>::iterator tmp = cur++;
- m_dataMap.erase(tmp);
- ++count;
- }
- else {
- cur++;
- }
- }
- return count;
-}
-
-bool MemoryStorageService::createString(const char* context, const char* key, const char* value, time_t expiration)
-{
- Context& ctx = writeContext(context);
- SharedLock locker(m_lock, false);
-
- // Check for a duplicate.
- map<string,Record>::iterator i=ctx.m_dataMap.find(key);
- if (i!=ctx.m_dataMap.end()) {
- // Not yet expired?
- if (time(NULL) < i->second.expiration)
- return false;
- // It's dead, so we can just remove it now and create the new record.
- ctx.m_dataMap.erase(i);
- }
-
- ctx.m_dataMap[key]=Record(value,expiration);
-
- m_log.debug("inserted record (%s) in context (%s)", key, context);
- return true;
-}
-
-int MemoryStorageService::readString(const char* context, const char* key, string* pvalue, time_t* pexpiration, int version)
-{
- Context& ctx = readContext(context);
- SharedLock locker(m_lock, false);
-
- map<string,Record>::iterator i=ctx.m_dataMap.find(key);
- if (i==ctx.m_dataMap.end())
- return 0;
- else if (time(NULL) >= i->second.expiration)
- return 0;
- if (pexpiration)
- *pexpiration = i->second.expiration;
- if (i->second.version == version)
- return version; // nothing's changed, so just echo back the version
- if (pvalue)
- *pvalue = i->second.data;
- return i->second.version;
-}
-
-int MemoryStorageService::updateString(const char* context, const char* key, const char* value, time_t expiration, int version)
-{
- Context& ctx = writeContext(context);
- SharedLock locker(m_lock, false);
-
- map<string,Record>::iterator i=ctx.m_dataMap.find(key);
- if (i==ctx.m_dataMap.end())
- return 0;
- else if (time(NULL) >= i->second.expiration)
- return 0;
-
- if (version > 0 && version != i->second.version)
- return -1; // caller's out of sync
-
- if (value) {
- i->second.data = value;
- ++(i->second.version);
- }
-
- if (expiration && expiration != i->second.expiration)
- i->second.expiration = expiration;
-
- m_log.debug("updated record (%s) in context (%s)", key, context);
- return i->second.version;
-}
-
-bool MemoryStorageService::deleteString(const char* context, const char* key)
-{
- Context& ctx = writeContext(context);
- SharedLock locker(m_lock, false);
-
- // Find the record.
- map<string,Record>::iterator i=ctx.m_dataMap.find(key);
- if (i!=ctx.m_dataMap.end()) {
- ctx.m_dataMap.erase(i);
- m_log.debug("deleted record (%s) in context (%s)", key, context);
- return true;
- }
-
- m_log.debug("deleting record (%s) in context (%s)....not found", key, context);
- return false;
-}
-
-void MemoryStorageService::updateContext(const char* context, time_t expiration)
-{
- Context& ctx = writeContext(context);
- SharedLock locker(m_lock, false);
-
- time_t now = time(NULL);
- map<string,Record>::iterator stop=ctx.m_dataMap.end();
- for (map<string,Record>::iterator i = ctx.m_dataMap.begin(); i!=stop; ++i) {
- if (now < i->second.expiration)
- i->second.expiration = expiration;
- }
-
- m_log.debug("updated expiration of valid records in context (%s)", context);
-}
+/*
+ * Copyright 2001-2007 Internet2
+ *
+ * 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.
+ */
+
+/**
+ * MemoryStorageService.cpp
+ *
+ * In-memory "persistent" storage, suitable for simple applications.
+ */
+
+#include "internal.h"
+#include "logging.h"
+#include "util/NDC.h"
+#include "util/StorageService.h"
+#include "util/Threads.h"
+#include "util/XMLHelper.h"
+
+#include <memory>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+using namespace xmltooling::logging;
+using namespace xmltooling;
+using namespace std;
+
+namespace xmltooling {
+ class XMLTOOL_DLLLOCAL MemoryStorageService : public StorageService
+ {
+ public:
+ MemoryStorageService(const DOMElement* e);
+ virtual ~MemoryStorageService();
+
+ bool createString(const char* context, const char* key, const char* value, time_t expiration);
+ int readString(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0);
+ int updateString(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0);
+ bool deleteString(const char* context, const char* key);
+
+ bool createText(const char* context, const char* key, const char* value, time_t expiration) {
+ return createString(context, key, value, expiration);
+ }
+ int readText(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) {
+ return readString(context, key, pvalue, pexpiration, version);
+ }
+ int updateText(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) {
+ return updateString(context, key, value, expiration, version);
+ }
+ bool deleteText(const char* context, const char* key) {
+ return deleteString(context, key);
+ }
+
+ void reap(const char* context);
+ void updateContext(const char* context, time_t expiration);
+ void deleteContext(const char* context) {
+ m_lock->wrlock();
+ m_contextMap.erase(context);
+ m_lock->unlock();
+ }
+
+ private:
+ void cleanup();
+
+ struct XMLTOOL_DLLLOCAL Record {
+ Record() : expiration(0), version(1) {}
+ Record(const string& s, time_t t) : data(s), expiration(t), version(1) {}
+ string data;
+ time_t expiration;
+ int version;
+ };
+
+ struct XMLTOOL_DLLLOCAL Context {
+ Context() {}
+ Context(const Context& src) {
+ m_dataMap = src.m_dataMap;
+ }
+ map<string,Record> m_dataMap;
+ unsigned long reap(time_t exp);
+ };
+
+ Context& readContext(const char* context) {
+ m_lock->rdlock();
+ map<string,Context>::iterator i = m_contextMap.find(context);
+ if (i != m_contextMap.end())
+ return i->second;
+ m_lock->unlock();
+ m_lock->wrlock();
+ return m_contextMap[context];
+ }
+
+ Context& writeContext(const char* context) {
+ m_lock->wrlock();
+ return m_contextMap[context];
+ }
+
+ map<string,Context> m_contextMap;
+ RWLock* m_lock;
+ CondWait* shutdown_wait;
+ Thread* cleanup_thread;
+ static void* cleanup_fn(void*);
+ bool shutdown;
+ int m_cleanupInterval;
+ Category& m_log;
+ };
+
+ StorageService* XMLTOOL_DLLLOCAL MemoryStorageServiceFactory(const DOMElement* const & e)
+ {
+ return new MemoryStorageService(e);
+ }
+};
+
+static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l);
+
+MemoryStorageService::MemoryStorageService(const DOMElement* e)
+ : m_lock(NULL), shutdown_wait(NULL), cleanup_thread(NULL), shutdown(false), m_cleanupInterval(0),
+ m_log(Category::getInstance(XMLTOOLING_LOGCAT".StorageService"))
+{
+ const XMLCh* tag=e ? e->getAttributeNS(NULL,cleanupInterval) : NULL;
+ if (tag && *tag) {
+ m_cleanupInterval = XMLString::parseInt(tag);
+ }
+ if (!m_cleanupInterval)
+ m_cleanupInterval=900;
+
+ m_lock = RWLock::create();
+ shutdown_wait = CondWait::create();
+ cleanup_thread = Thread::create(&cleanup_fn, (void*)this);
+}
+
+MemoryStorageService::~MemoryStorageService()
+{
+ // Shut down the cleanup thread and let it know...
+ shutdown = true;
+ shutdown_wait->signal();
+ cleanup_thread->join(NULL);
+
+ delete shutdown_wait;
+ delete m_lock;
+}
+
+void* MemoryStorageService::cleanup_fn(void* cache_p)
+{
+ MemoryStorageService* cache = reinterpret_cast<MemoryStorageService*>(cache_p);
+
+#ifndef WIN32
+ // First, let's block all signals
+ Thread::mask_all_signals();
+#endif
+
+ // Now run the cleanup process.
+ cache->cleanup();
+ return NULL;
+}
+
+void MemoryStorageService::cleanup()
+{
+#ifdef _DEBUG
+ NDC ndc("cleanup");
+#endif
+
+ auto_ptr<Mutex> mutex(Mutex::create());
+ mutex->lock();
+
+ m_log.info("cleanup thread started...running every %d seconds", m_cleanupInterval);
+
+ while (!shutdown) {
+ shutdown_wait->timedwait(mutex.get(), m_cleanupInterval);
+ if (shutdown)
+ break;
+
+ unsigned long count=0;
+ time_t now = time(NULL);
+ m_lock->wrlock();
+ SharedLock locker(m_lock, false);
+ for (map<string,Context>::iterator i=m_contextMap.begin(); i!=m_contextMap.end(); ++i)
+ count += i->second.reap(now);
+
+ if (count)
+ m_log.info("purged %d expired record(s) from storage", count);
+ }
+
+ m_log.info("cleanup thread finished");
+
+ mutex->unlock();
+ Thread::exit(NULL);
+}
+
+void MemoryStorageService::reap(const char* context)
+{
+ Context& ctx = writeContext(context);
+ SharedLock locker(m_lock, false);
+ ctx.reap(time(NULL));
+}
+
+unsigned long MemoryStorageService::Context::reap(time_t exp)
+{
+ // Garbage collect any expired entries.
+ unsigned long count=0;
+ map<string,Record>::iterator cur = m_dataMap.begin();
+ map<string,Record>::iterator stop = m_dataMap.end();
+ while (cur != stop) {
+ if (cur->second.expiration <= exp) {
+ map<string,Record>::iterator tmp = cur++;
+ m_dataMap.erase(tmp);
+ ++count;
+ }
+ else {
+ cur++;
+ }
+ }
+ return count;
+}
+
+bool MemoryStorageService::createString(const char* context, const char* key, const char* value, time_t expiration)
+{
+ Context& ctx = writeContext(context);
+ SharedLock locker(m_lock, false);
+
+ // Check for a duplicate.
+ map<string,Record>::iterator i=ctx.m_dataMap.find(key);
+ if (i!=ctx.m_dataMap.end()) {
+ // Not yet expired?
+ if (time(NULL) < i->second.expiration)
+ return false;
+ // It's dead, so we can just remove it now and create the new record.
+ ctx.m_dataMap.erase(i);
+ }
+
+ ctx.m_dataMap[key]=Record(value,expiration);
+
+ m_log.debug("inserted record (%s) in context (%s)", key, context);
+ return true;
+}
+
+int MemoryStorageService::readString(const char* context, const char* key, string* pvalue, time_t* pexpiration, int version)
+{
+ Context& ctx = readContext(context);
+ SharedLock locker(m_lock, false);
+
+ map<string,Record>::iterator i=ctx.m_dataMap.find(key);
+ if (i==ctx.m_dataMap.end())
+ return 0;
+ else if (time(NULL) >= i->second.expiration)
+ return 0;
+ if (pexpiration)
+ *pexpiration = i->second.expiration;
+ if (i->second.version == version)
+ return version; // nothing's changed, so just echo back the version
+ if (pvalue)
+ *pvalue = i->second.data;
+ return i->second.version;
+}
+
+int MemoryStorageService::updateString(const char* context, const char* key, const char* value, time_t expiration, int version)
+{
+ Context& ctx = writeContext(context);
+ SharedLock locker(m_lock, false);
+
+ map<string,Record>::iterator i=ctx.m_dataMap.find(key);
+ if (i==ctx.m_dataMap.end())
+ return 0;
+ else if (time(NULL) >= i->second.expiration)
+ return 0;
+
+ if (version > 0 && version != i->second.version)
+ return -1; // caller's out of sync
+
+ if (value) {
+ i->second.data = value;
+ ++(i->second.version);
+ }
+
+ if (expiration && expiration != i->second.expiration)
+ i->second.expiration = expiration;
+
+ m_log.debug("updated record (%s) in context (%s)", key, context);
+ return i->second.version;
+}
+
+bool MemoryStorageService::deleteString(const char* context, const char* key)
+{
+ Context& ctx = writeContext(context);
+ SharedLock locker(m_lock, false);
+
+ // Find the record.
+ map<string,Record>::iterator i=ctx.m_dataMap.find(key);
+ if (i!=ctx.m_dataMap.end()) {
+ ctx.m_dataMap.erase(i);
+ m_log.debug("deleted record (%s) in context (%s)", key, context);
+ return true;
+ }
+
+ m_log.debug("deleting record (%s) in context (%s)....not found", key, context);
+ return false;
+}
+
+void MemoryStorageService::updateContext(const char* context, time_t expiration)
+{
+ Context& ctx = writeContext(context);
+ SharedLock locker(m_lock, false);
+
+ time_t now = time(NULL);
+ map<string,Record>::iterator stop=ctx.m_dataMap.end();
+ for (map<string,Record>::iterator i = ctx.m_dataMap.begin(); i!=stop; ++i) {
+ if (now < i->second.expiration)
+ i->second.expiration = expiration;
+ }
+
+ m_log.debug("updated expiration of valid records in context (%s)", context);
+}
diff --git a/xmltooling/io/HTTPRequest.h b/xmltooling/io/HTTPRequest.h
index 2a5abf7..a600be2 100644
--- a/xmltooling/io/HTTPRequest.h
+++ b/xmltooling/io/HTTPRequest.h
@@ -26,6 +26,7 @@
#include <xmltooling/io/GenericRequest.h>
#include <map>
+#include <cstring>
namespace xmltooling {
diff --git a/xmltooling/security/BasicX509Credential.h b/xmltooling/security/BasicX509Credential.h
index e33e785..9241fd0 100644
--- a/xmltooling/security/BasicX509Credential.h
+++ b/xmltooling/security/BasicX509Credential.h
@@ -87,8 +87,10 @@ namespace xmltooling {
/**
* Initializes (or reinitializes) a ds:KeyInfo to represent the Credential.
+ *
+ * @param types the kinds of KeyInfo content to include
*/
- void initKeyInfo();
+ void initKeyInfo(unsigned int types=0);
public:
virtual ~BasicX509Credential();
diff --git a/xmltooling/security/Credential.h b/xmltooling/security/Credential.h
index 02d4999..ecd575a 100644
--- a/xmltooling/security/Credential.h
+++ b/xmltooling/security/Credential.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,8 +16,8 @@
/**
* @file xmltooling/security/Credential.h
- *
- * Wraps keys and related functionality.
+ *
+ * Wraps keys and related functionality.
*/
#if !defined(__xmltooling_cred_h__) && !defined(XMLTOOLING_NO_XMLSEC)
@@ -49,12 +49,12 @@ namespace xmltooling {
MAKE_NONCOPYABLE(Credential);
protected:
Credential() {}
-
+
public:
virtual ~Credential() {}
-
+
/**
- * Bitmask constants for limiting resolution process inside a CredentialResolver.
+ * Bitmask constants for limiting resolution process inside a CredentialResolver.
*/
enum ResolveTypes {
RESOLVE_KEYS = 1,
@@ -62,7 +62,7 @@ namespace xmltooling {
};
/**
- * Bitmask of use cases for credentials.
+ * Bitmask of use cases for credentials.
*/
enum UsageTypes {
UNSPECIFIED_CREDENTIAL = 0,
@@ -70,10 +70,18 @@ namespace xmltooling {
TLS_CREDENTIAL = 2,
ENCRYPTION_CREDENTIAL = 4
};
-
+
+ /**
+ * Bitmask of supported KeyInfo content to generate.
+ */
+ enum KeyInfoTypes {
+ KEYINFO_KEY_VALUE = 1,
+ KEYINFO_KEY_NAME = 2
+ };
+
/**
* Get credential usage types.
- *
+ *
* @return the usage bitmask
*/
virtual unsigned int getUsage() const=0;
@@ -94,32 +102,32 @@ namespace xmltooling {
/**
* Returns a secret or private key to use for signing or decryption operations.
- *
+ *
* @return a secret or private key
*/
virtual XSECCryptoKey* getPrivateKey() const=0;
/**
* Returns a secret or public key to use for verification or encryption operations.
- *
+ *
* @return a secret or public key
*/
virtual XSECCryptoKey* getPublicKey() const=0;
-
+
/**
* Returns names representing the Credential.
*
* <p>Names should be unique in the context of the comparisons against CredentialCriteria
* that deployments expect to see.
- *
+ *
* @return a sorted set of names
*/
virtual const std::set<std::string>& getKeyNames() const=0;
-
+
/**
* Returns a ds:KeyInfo object representing the Credential for use in
* communicating with other entities.
- *
+ *
* @param compact true iff the communication medium is such that only compact forms should be included
* @return a KeyInfo object, which must be freed by the caller
*/
@@ -128,7 +136,7 @@ namespace xmltooling {
/**
* Get the credential context information, which provides additional information
* specific to the context in which the credential was resolved.
- *
+ *
* @return resolution context of the credential
*/
virtual const CredentialContext* getCredentalContext() const {
diff --git a/xmltooling/security/X509Credential.h b/xmltooling/security/X509Credential.h
index a4d6e69..59dcd07 100644
--- a/xmltooling/security/X509Credential.h
+++ b/xmltooling/security/X509Credential.h
@@ -50,6 +50,15 @@ namespace xmltooling {
};
/**
+ * Bitmask of supported KeyInfo content to generate.
+ */
+ enum KeyInfoTypes {
+ KEYINFO_X509_CERTIFICATE = 4,
+ KEYINFO_X509_SUBJECTNAME = 8,
+ KEYINFO_X509_ISSUERSERIAL = 16
+ };
+
+ /**
* Gets an immutable collection of certificates in the entity's trust chain. The entity certificate is contained
* within this list. No specific ordering of the certificates is guaranteed.
*
diff --git a/xmltooling/security/impl/BasicX509Credential.cpp b/xmltooling/security/impl/BasicX509Credential.cpp
index f6bd596..50da3ed 100644
--- a/xmltooling/security/impl/BasicX509Credential.cpp
+++ b/xmltooling/security/impl/BasicX509Credential.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,8 +16,8 @@
/**
* BasicX509Credential.cpp
- *
- * Wraps an X.509-based Credential by storing key/cert objects inside.
+ *
+ * Wraps an X.509-based Credential by storing key/cert objects inside.
*/
#include "internal.h"
@@ -42,54 +42,61 @@ BasicX509Credential::~BasicX509Credential()
delete m_compactKeyInfo;
}
-void BasicX509Credential::initKeyInfo()
+void BasicX509Credential::initKeyInfo(unsigned int types)
{
delete m_keyInfo;
m_keyInfo = NULL;
delete m_compactKeyInfo;
m_compactKeyInfo = NULL;
- const set<string>& names = getKeyNames();
- if (!names.empty()) {
- m_compactKeyInfo = KeyInfoBuilder::buildKeyInfo();
- VectorOf(KeyName) knames = m_compactKeyInfo->getKeyNames();
- for (set<string>::const_iterator n = names.begin(); n!=names.end(); ++n) {
- if (*n == m_subjectName)
- continue;
- auto_ptr_XMLCh wide(n->c_str());
- KeyName* kname = KeyNameBuilder::buildKeyName();
- kname->setName(wide.get());
- knames.push_back(kname);
- }
- }
+ if (types == 0)
+ types = KEYINFO_KEY_VALUE | KEYINFO_KEY_NAME | KEYINFO_X509_CERTIFICATE | KEYINFO_X509_SUBJECTNAME | KEYINFO_X509_ISSUERSERIAL;
- if (!m_subjectName.empty() || (!m_issuerName.empty() && !m_serial.empty())) {
- if (!m_compactKeyInfo)
+ if (types & KEYINFO_KEY_NAME) {
+ const set<string>& names = getKeyNames();
+ if (!names.empty()) {
m_compactKeyInfo = KeyInfoBuilder::buildKeyInfo();
- X509Data* x509Data=X509DataBuilder::buildX509Data();
- m_compactKeyInfo->getX509Datas().push_back(x509Data);
- if (!m_subjectName.empty()) {
- X509SubjectName* sn = X509SubjectNameBuilder::buildX509SubjectName();
- auto_ptr_XMLCh wide(m_subjectName.c_str());
- sn->setName(wide.get());
- x509Data->getX509SubjectNames().push_back(sn);
+ VectorOf(KeyName) knames = m_compactKeyInfo->getKeyNames();
+ for (set<string>::const_iterator n = names.begin(); n!=names.end(); ++n) {
+ if (*n == m_subjectName)
+ continue;
+ auto_ptr_XMLCh wide(n->c_str());
+ KeyName* kname = KeyNameBuilder::buildKeyName();
+ kname->setName(wide.get());
+ knames.push_back(kname);
+ }
}
-
- if (!m_issuerName.empty() && !m_serial.empty()) {
- X509IssuerSerial* is = X509IssuerSerialBuilder::buildX509IssuerSerial();
- X509IssuerName* in = X509IssuerNameBuilder::buildX509IssuerName();
- auto_ptr_XMLCh wide(m_issuerName.c_str());
- in->setName(wide.get());
- is->setX509IssuerName(in);
- X509SerialNumber* ser = X509SerialNumberBuilder::buildX509SerialNumber();
- auto_ptr_XMLCh wide2(m_serial.c_str());
- ser->setSerialNumber(wide2.get());
- is->setX509SerialNumber(ser);
- x509Data->getX509IssuerSerials().push_back(is);
+ }
+
+ if (types & KEYINFO_X509_SUBJECTNAME || types & KEYINFO_X509_ISSUERSERIAL) {
+ if (!m_subjectName.empty() || (!m_issuerName.empty() && !m_serial.empty())) {
+ if (!m_compactKeyInfo)
+ m_compactKeyInfo = KeyInfoBuilder::buildKeyInfo();
+ X509Data* x509Data=X509DataBuilder::buildX509Data();
+ m_compactKeyInfo->getX509Datas().push_back(x509Data);
+ if (types & KEYINFO_X509_SUBJECTNAME && !m_subjectName.empty()) {
+ X509SubjectName* sn = X509SubjectNameBuilder::buildX509SubjectName();
+ auto_ptr_XMLCh wide(m_subjectName.c_str());
+ sn->setName(wide.get());
+ x509Data->getX509SubjectNames().push_back(sn);
+ }
+
+ if (types & KEYINFO_X509_ISSUERSERIAL && !m_issuerName.empty() && !m_serial.empty()) {
+ X509IssuerSerial* is = X509IssuerSerialBuilder::buildX509IssuerSerial();
+ X509IssuerName* in = X509IssuerNameBuilder::buildX509IssuerName();
+ auto_ptr_XMLCh wide(m_issuerName.c_str());
+ in->setName(wide.get());
+ is->setX509IssuerName(in);
+ X509SerialNumber* ser = X509SerialNumberBuilder::buildX509SerialNumber();
+ auto_ptr_XMLCh wide2(m_serial.c_str());
+ ser->setSerialNumber(wide2.get());
+ is->setX509SerialNumber(ser);
+ x509Data->getX509IssuerSerials().push_back(is);
+ }
}
}
-
- if (!m_xseccerts.empty()) {
+
+ if (types & KEYINFO_X509_CERTIFICATE && !m_xseccerts.empty()) {
m_keyInfo = m_compactKeyInfo ? m_compactKeyInfo->cloneKeyInfo() : KeyInfoBuilder::buildKeyInfo();
if (m_keyInfo->getX509Datas().empty())
m_keyInfo->getX509Datas().push_back(X509DataBuilder::buildX509Data());
@@ -140,7 +147,7 @@ void BasicX509Credential::extract()
}
BN_free(serialBN);
}
-
+
X509_NAME* subject=X509_get_subject_name(cert);
if (subject) {
memset(buf,0,sizeof(buf));
@@ -194,7 +201,7 @@ const char* BasicX509Credential::getAlgorithm() const
case XSECCryptoKey::KEY_DSA_PUBLIC:
case XSECCryptoKey::KEY_DSA_PAIR:
return "DSA";
-
+
case XSECCryptoKey::KEY_HMAC:
return "HMAC";
diff --git a/xmltooling/security/impl/ChainingCredentialResolver.cpp b/xmltooling/security/impl/ChainingCredentialResolver.cpp
index 230afbc..f98ec7c 100644
--- a/xmltooling/security/impl/ChainingCredentialResolver.cpp
+++ b/xmltooling/security/impl/ChainingCredentialResolver.cpp
@@ -43,11 +43,11 @@ namespace xmltooling {
}
Lockable* lock() {
- for_each(m_resolvers.begin(), m_resolvers.end(), mem_fun(&CredentialResolver::lock));
+ for_each(m_resolvers.begin(), m_resolvers.end(), mem_fun(&Lockable::lock));
return this;
}
void unlock() {
- for_each(m_resolvers.begin(), m_resolvers.end(), mem_fun(&CredentialResolver::unlock));
+ for_each(m_resolvers.begin(), m_resolvers.end(), mem_fun(&Lockable::unlock));
}
const Credential* resolve(const CredentialCriteria* criteria=NULL) const {
diff --git a/xmltooling/security/impl/FilesystemCredentialResolver.cpp b/xmltooling/security/impl/FilesystemCredentialResolver.cpp
index a4bef3c..b36eef0 100644
--- a/xmltooling/security/impl/FilesystemCredentialResolver.cpp
+++ b/xmltooling/security/impl/FilesystemCredentialResolver.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,7 +16,7 @@
/**
* FilesystemCredentialResolver.cpp
- *
+ *
* Supplies credentials from local files
*/
@@ -55,7 +55,7 @@ static int passwd_callback(char* buf, int len, int verify, void* passwd)
strcpy(buf,reinterpret_cast<char*>(passwd));
return strlen(buf);
}
- }
+ }
return 0;
}
@@ -74,7 +74,6 @@ namespace xmltooling {
FilesystemCredentialResolver* resolver, XSECCryptoKey* key, const std::vector<XSECCryptoX509*>& xseccerts, XSECCryptoX509CRL* crl=NULL
) : BasicX509Credential(key, xseccerts, crl), m_resolver(resolver), m_usage(UNSPECIFIED_CREDENTIAL) {
extract();
- initKeyInfo();
}
virtual ~FilesystemCredential() {
}
@@ -97,8 +96,12 @@ namespace xmltooling {
void addKeyNames(const DOMElement* e);
+ void initKeyInfo(unsigned int types=0) {
+ BasicX509Credential::initKeyInfo(types);
+ }
+
void attach(SSL_CTX* ctx) const;
-
+
private:
FilesystemCredentialResolver* m_resolver;
unsigned int m_usage;
@@ -119,7 +122,7 @@ namespace xmltooling {
Lockable* lock() { return this; }
void unlock() {}
-
+
const Credential* resolve(const CredentialCriteria* criteria=NULL) const {
return (criteria ? (criteria->matches(*m_credential) ? m_credential : NULL) : m_credential);
}
@@ -139,13 +142,13 @@ namespace xmltooling {
private:
XSECCryptoKey* loadKey();
XSECCryptoX509CRL* loadCRL();
-
+
enum format_t { PEM=SSL_FILETYPE_PEM, DER=SSL_FILETYPE_ASN1, _PKCS12, UNKNOWN };
-
+
format_t getEncodingFormat(BIO* in) const;
string formatToString(format_t format) const;
format_t xmlFormatToFormat(const XMLCh* format_xml) const;
-
+
format_t m_keyformat,m_crlformat;
string m_keypath,m_keypass,m_crlpath;
vector<X509*> m_certs;
@@ -165,6 +168,7 @@ namespace xmltooling {
static const XMLCh format[] = UNICODE_LITERAL_6(f,o,r,m,a,t);
static const XMLCh Key[] = UNICODE_LITERAL_3(K,e,y);
static const XMLCh _key[] = UNICODE_LITERAL_3(k,e,y);
+ static const XMLCh keyInfoMask[] = UNICODE_LITERAL_11(k,e,y,I,n,f,o,M,a,s,k);
static const XMLCh keyName[] = UNICODE_LITERAL_7(k,e,y,N,a,m,e);
static const XMLCh Name[] = UNICODE_LITERAL_4(N,a,m,e);
static const XMLCh password[] = UNICODE_LITERAL_8(p,a,s,s,w,o,r,d);
@@ -179,6 +183,15 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
#endif
Category& log=Category::getInstance(XMLTOOLING_LOGCAT".CredentialResolver."FILESYSTEM_CREDENTIAL_RESOLVER);
+ // Default to disable X509IssuerSerial due to schema validation issues.
+ unsigned int mask =
+ Credential::KEYINFO_KEY_NAME |
+ Credential::KEYINFO_KEY_VALUE |
+ X509Credential::KEYINFO_X509_CERTIFICATE |
+ X509Credential::KEYINFO_X509_SUBJECTNAME;
+ if (e && e->hasAttributeNS(NULL,keyInfoMask))
+ mask = XMLString::parseInt(e->getAttributeNS(NULL,keyInfoMask));
+
if (e && (e->hasAttributeNS(NULL,_certificate) || e->hasAttributeNS(NULL,_key))) {
// Dummy up a simple file resolver config using these attributes.
DOMElement* dummy = e->getOwnerDocument()->createElementNS(NULL,_CredentialResolver);
@@ -207,7 +220,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
}
e = dummy; // reset "root" to the dummy config element
}
-
+
const DOMElement* root=e;
const XMLCh* usage = root->getAttributeNS(NULL,_use);
@@ -218,20 +231,20 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
format_t fformat;
const XMLCh* format_xml=NULL;
BIO* in = NULL;
-
+
// Move to Key
const DOMElement* keynode=XMLHelper::getFirstChildElement(root,Key);
if (keynode) {
- // Get raw format attrib value, but defer processing til later since may need to
+ // Get raw format attrib value, but defer processing til later since may need to
// determine format dynamically, and we need the Path for that.
format_xml=keynode->getAttributeNS(NULL,format);
-
+
const XMLCh* password_xml=keynode->getAttributeNS(NULL,password);
if (password_xml) {
auto_ptr_char kp(password_xml);
m_keypass=kp.get();
}
-
+
e=XMLHelper::getFirstChildElement(keynode,Path);
if (e && e->hasChildNodes()) {
const XMLCh* s=e->getFirstChild()->getNodeValue();
@@ -279,20 +292,20 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
}
if (in)
BIO_free(in);
- in = NULL;
+ in = NULL;
}
-
+
// Load the key.
key = loadKey();
}
-
+
// Check for CRL.
const DOMElement* crlnode=XMLHelper::getFirstChildElement(root,CRL);
if (crlnode) {
- // Get raw format attrib value, but defer processing til later since may need to
+ // Get raw format attrib value, but defer processing til later since may need to
// determine format dynamically, and we need the Path for that.
format_xml=crlnode->getAttributeNS(NULL,format);
-
+
e=XMLHelper::getFirstChildElement(crlnode,Path);
if (e && e->hasChildNodes()) {
const XMLCh* s=e->getFirstChild()->getNodeValue();
@@ -342,7 +355,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
BIO_free(in);
in = NULL;
}
-
+
// Load the key.
crl = loadCRL();
}
@@ -353,10 +366,11 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
m_credential = new FilesystemCredential(this,key,xseccerts,crl);
m_credential->addKeyNames(keynode);
m_credential->setUsage(usage);
+ m_credential->initKeyInfo(mask);
return;
}
auto_ptr_char certpass(e->getAttributeNS(NULL,password));
-
+
const DOMElement* ep=XMLHelper::getFirstChildElement(e,Path);
if (!ep || !ep->hasChildNodes()) {
log.error("Path element missing inside Certificate element or is empty");
@@ -364,7 +378,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
delete crl;
throw XMLSecurityException("FilesystemCredentialResolver can't access certificate file, missing or empty Path element.");
}
-
+
auto_ptr_char certpath2(ep->getFirstChild()->getNodeValue());
string certpath(certpath2.get());
XMLToolingConfig::getConfig().getPathResolver()->resolve(certpath, PathResolver::XMLTOOLING_CFG_FILE);
@@ -380,7 +394,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
throw XMLSecurityException("FilesystemCredentialResolver configuration contains unknown certificate encoding format ($1)",params(1,unknown.get()));
}
}
-
+
try {
X509* x=NULL;
PKCS12* p12=NULL;
@@ -401,7 +415,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
while (x=PEM_read_bio_X509(in,NULL,passwd_callback,const_cast<char*>(certpass.get())))
m_certs.push_back(x);
break;
-
+
case DER:
x=d2i_X509_bio(in,NULL);
if (x)
@@ -515,7 +529,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
log.error("CA certificate file (%s) can't be opened", capath.c_str());
throw XMLSecurityException("FilesystemCredentialResolver can't open CA certificate file ($1)",params(1,capath.c_str()));
}
-
+
extra = XMLHelper::getNextSiblingElement(extra,CAPath);
}
}
@@ -534,6 +548,7 @@ FilesystemCredentialResolver::FilesystemCredentialResolver(const DOMElement* e)
m_credential = new FilesystemCredential(this, key, xseccerts, crl);
m_credential->addKeyNames(keynode);
m_credential->setUsage(usage);
+ m_credential->initKeyInfo(mask);
}
XSECCryptoKey* FilesystemCredentialResolver::loadKey()
@@ -553,11 +568,11 @@ XSECCryptoKey* FilesystemCredentialResolver::loadKey()
case PEM:
pkey=PEM_read_bio_PrivateKey(in, NULL, passwd_callback, const_cast<char*>(m_keypass.c_str()));
break;
-
+
case DER:
pkey=d2i_PrivateKey_bio(in, NULL);
break;
-
+
default: {
PKCS12* p12 = d2i_PKCS12_bio(in, NULL);
if (p12) {
@@ -569,7 +584,7 @@ XSECCryptoKey* FilesystemCredentialResolver::loadKey()
}
if (in)
BIO_free(in);
-
+
// Now map it to an XSEC wrapper.
if (pkey) {
XSECCryptoKey* ret=NULL;
@@ -577,11 +592,11 @@ XSECCryptoKey* FilesystemCredentialResolver::loadKey()
case EVP_PKEY_RSA:
ret=new OpenSSLCryptoKeyRSA(pkey);
break;
-
+
case EVP_PKEY_DSA:
ret=new OpenSSLCryptoKeyDSA(pkey);
break;
-
+
default:
Category::getInstance(XMLTOOLING_LOGCAT".CredentialResolver."FILESYSTEM_CREDENTIAL_RESOLVER).error("unsupported private key type");
}
@@ -591,7 +606,7 @@ XSECCryptoKey* FilesystemCredentialResolver::loadKey()
}
log_openssl();
- throw XMLSecurityException("FilesystemCredentialResolver unable to load private key from file.");
+ throw XMLSecurityException("FilesystemCredentialResolver unable to load private key from file.");
}
XSECCryptoX509CRL* FilesystemCredentialResolver::loadCRL()
@@ -610,7 +625,7 @@ XSECCryptoX509CRL* FilesystemCredentialResolver::loadCRL()
case PEM:
crl=PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
break;
-
+
case DER:
crl=d2i_X509_CRL_bio(in, NULL);
break;
@@ -618,7 +633,7 @@ XSECCryptoX509CRL* FilesystemCredentialResolver::loadCRL()
}
if (in)
BIO_free(in);
-
+
// Now map it to an XSEC wrapper.
if (crl) {
XSECCryptoX509CRL* ret=new OpenSSLCryptoX509CRL(crl);
@@ -627,7 +642,7 @@ XSECCryptoX509CRL* FilesystemCredentialResolver::loadCRL()
}
log_openssl();
- throw XMLSecurityException("FilesystemCredentialResolver unable to load CRL from file.");
+ throw XMLSecurityException("FilesystemCredentialResolver unable to load CRL from file.");
}
// Used to determine the encoding format of credentials files
@@ -643,11 +658,11 @@ FilesystemCredentialResolver::format_t FilesystemCredentialResolver::getEncoding
int mark;
try {
- if ( (mark = BIO_tell(in)) < 0 )
+ if ( (mark = BIO_tell(in)) < 0 )
throw XMLSecurityException("getEncodingFormat: BIO_tell() can't get the file position");
- if ( BIO_read(in, buf, READSIZE) <= 0 )
+ if ( BIO_read(in, buf, READSIZE) <= 0 )
throw XMLSecurityException("getEncodingFormat: BIO_read() can't read from the stream");
- if ( BIO_seek(in, mark) < 0 )
+ if ( BIO_seek(in, mark) < 0 )
throw XMLSecurityException("getEncodingFormat: BIO_seek() can't reset the file position");
}
catch (...) {
@@ -674,7 +689,7 @@ FilesystemCredentialResolver::format_t FilesystemCredentialResolver::getEncoding
format = _PKCS12;
}
if (p12)
- PKCS12_free(p12);
+ PKCS12_free(p12);
if ( BIO_seek(in, mark) < 0 ) {
log_openssl();
throw XMLSecurityException("getEncodingFormat: BIO_seek() can't reset the file position");
@@ -737,11 +752,11 @@ void FilesystemCredentialResolver::attach(SSL_CTX* ctx) const
case PEM:
ret=SSL_CTX_use_PrivateKey_file(ctx, m_keypath.c_str(), m_keyformat);
break;
-
+
case DER:
ret=SSL_CTX_use_RSAPrivateKey_file(ctx, m_keypath.c_str(), m_keyformat);
break;
-
+
default: {
BIO* in=BIO_new(BIO_s_file_internal());
if (in && BIO_read_filename(in,m_keypath.c_str())>0) {
@@ -760,7 +775,7 @@ void FilesystemCredentialResolver::attach(SSL_CTX* ctx) const
BIO_free(in);
}
}
-
+
if (ret!=1) {
log_openssl();
throw XMLSecurityException("Unable to attach private key to SSL context.");
diff --git a/xmltooling/security/impl/InlineKeyResolver.cpp b/xmltooling/security/impl/InlineKeyResolver.cpp
index 45136c5..6b71a9a 100644
--- a/xmltooling/security/impl/InlineKeyResolver.cpp
+++ b/xmltooling/security/impl/InlineKeyResolver.cpp
@@ -172,6 +172,8 @@ void InlineCredential::resolve(const KeyInfo* keyInfo, int types)
// If we have a cert, just use it.
if (!m_xseccerts.empty())
m_key = m_xseccerts.front()->clonePublicKey();
+ else
+ resolveKey(keyInfo);
}
// Otherwise try directly for a key and then go for certs if none is found.
else if (!resolveKey(keyInfo) && resolveCerts(keyInfo)) {
diff --git a/xmltooling/soap/SOAPTransport.h b/xmltooling/soap/SOAPTransport.h
index 55ec9e0..ec6ed9c 100644
--- a/xmltooling/soap/SOAPTransport.h
+++ b/xmltooling/soap/SOAPTransport.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,7 +16,7 @@
/**
* @file xmltooling/soap/SOAPTransport.h
- *
+ *
* Encapsulates a transport layer protocol for sending/receiving messages.
*/
@@ -27,15 +27,15 @@
#include <iostream>
namespace xmltooling {
-
+
class XMLTOOL_API Credential;
class XMLTOOL_API CredentialCriteria;
class XMLTOOL_API CredentialResolver;
class XMLTOOL_API X509TrustEngine;
-
+
/**
* Encapsulates a transport layer protocol for sending/receiving messages.
- *
+ *
* Most of the methods are const, meaning they don't affect the transport
* layer until the data is sent.
*/
@@ -73,27 +73,27 @@ namespace xmltooling {
/**
* Indicates whether transport provides confidentiality.
- *
+ *
* @return true iff transport layer provides confidentiality
*/
virtual bool isConfidential() const=0;
-
+
/**
* Sets the connection timeout.
- *
+ *
* @param timeout time to wait for connection to server in seconds, or -1 for no timeout
* @return true iff the transport supports connection timeouts
*/
virtual bool setConnectTimeout(long timeout)=0;
-
+
/**
* Sets the request timeout.
- *
+ *
* @param timeout time to wait for a response in seconds, or -1 for no timeout
* @return true iff the transport supports request/response timeouts
*/
virtual bool setTimeout(long timeout)=0;
-
+
/**
* Common types of transport authentication that may be supported.
*/
@@ -104,10 +104,10 @@ namespace xmltooling {
transport_auth_ntlm = 3,
transport_auth_gss = 4
};
-
+
/**
* Sets a particular form of transport authentication and credentials.
- *
+ *
* @param authType type of transport authentication to use
* @param username username for transport authentication
* @param password simple password/credential for transport authentication
@@ -119,18 +119,18 @@ namespace xmltooling {
* Determines whether TLS/SSL connections include a check of the server's certificate
* against the expected hostname or address. Defaults to true, and has no effect for
* insecure protocols.
- *
+ *
* @param verify true iff the hostname should be verified against the server's certificate
* @return true iff the transport supports hostname verification
*/
virtual bool setVerifyHost(bool verify)=0;
-
+
#ifndef XMLTOOLING_NO_XMLSEC
/**
* Supplies transport credentials.
*
* <p>The lifetime of the credential must be longer than the lifetime of this object.
- *
+ *
* @param credential a Credential instance, or NULL
* @return true iff the transport supports the use of the Credential
*/
@@ -139,7 +139,7 @@ namespace xmltooling {
/**
* Provides an X509TrustEngine to the transport to authenticate the transport peer.
* The lifetime of the engine must be longer than the lifetime of this object.
- *
+ *
* @param trustEngine an X509TrustEngine instance, or NULL
* @param credResolver a CredentialResolver to supply the peer's trusted credentials, or NULL
* @param criteria optional criteria for selecting peer credentials
@@ -157,10 +157,10 @@ namespace xmltooling {
/**
* Sets an implementation-specific transport provider option.
- *
+ *
* <p>Requires knowledge of the underlying SOAPTransport implementation.
* Without the proper knowledge and inputs, crashes may result.
- *
+ *
* @param provider name of the SOAPTransport class the caller believes is in use
* @param option implementation-specific string containing the option to set
* @param value implementation- and option-specific string to use
@@ -169,33 +169,36 @@ namespace xmltooling {
virtual bool setProviderOption(const char* provider, const char* option, const char* value) {
return false;
}
-
+
/**
* Sends a stream of data over the transport. The function may return without
* having received any data, depending on the nature of the transport.
- *
+ *
+ * <p>If the stream is empty, a request may be issued with no body if the transport
+ * supports that feature.
+ *
* @param in input stream to send
- */
+ */
virtual void send(std::istream& in)=0;
-
+
/**
* Returns reference to response stream. The resulting stream must be
* checked directly to determine whether data is available.
- *
+ *
* @return reference to a stream containing the response, if any
*/
virtual std::istream& receive()=0;
-
+
/**
* Returns result of authenticating transport peer.
- *
+ *
* @return true iff TrustEngine or other mechanism successfully authenticated the peer
*/
virtual bool isAuthenticated() const=0;
/**
* Returns the MIME type of the response, if any.
- *
+ *
* @return MIME type of response, or an empty string
*/
virtual std::string getContentType() const=0;
@@ -206,14 +209,14 @@ namespace xmltooling {
* Registers SOAPTransport classes into the runtime.
*/
void XMLTOOL_API registerSOAPTransports();
-
+
/**
- * Notifies transport infrastructure to initialize.
+ * Notifies transport infrastructure to initialize.
*/
void XMLTOOL_API initSOAPTransports();
-
+
/**
- * Notifies transport infrastructure to shutdown.
+ * Notifies transport infrastructure to shutdown.
*/
void XMLTOOL_API termSOAPTransports();
#endif
diff --git a/xmltooling/soap/impl/CURLSOAPTransport.cpp b/xmltooling/soap/impl/CURLSOAPTransport.cpp
index 811bde5..0aca880 100644
--- a/xmltooling/soap/impl/CURLSOAPTransport.cpp
+++ b/xmltooling/soap/impl/CURLSOAPTransport.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,7 +16,7 @@
/**
* CURLSOAPTransport.cpp
- *
+ *
* libcurl-based SOAPTransport implementation
*/
@@ -48,11 +48,11 @@ namespace xmltooling {
CURLPool() : m_size(0), m_lock(Mutex::create()),
m_log(Category::getInstance(XMLTOOLING_LOGCAT".SOAPTransport.CURL")) {}
~CURLPool();
-
+
CURL* get(const SOAPTransport::Address& addr);
void put(const char* from, const char* to, const char* endpoint, CURL* handle);
-
- private:
+
+ private:
typedef map<string,vector<CURL*> > poolmap_t;
poolmap_t m_bindingMap;
list< vector<CURL*>* > m_pools;
@@ -60,9 +60,9 @@ namespace xmltooling {
Mutex* m_lock;
Category& m_log;
};
-
+
static XMLTOOL_DLLLOCAL CURLPool* g_CURLPool = NULL;
-
+
class XMLTOOL_DLLLOCAL CURLSOAPTransport : public HTTPSOAPTransport, public OpenSSLSOAPTransport
{
public:
@@ -83,7 +83,7 @@ namespace xmltooling {
curl_easy_setopt(m_handle,CURLOPT_HEADERDATA,this);
m_headers=curl_slist_append(m_headers,"Content-Type: text/xml");
}
-
+
virtual ~CURLSOAPTransport() {
curl_slist_free_all(m_headers);
curl_easy_setopt(m_handle,CURLOPT_ERRORBUFFER,NULL);
@@ -98,17 +98,17 @@ namespace xmltooling {
bool setConnectTimeout(long timeout) {
return (curl_easy_setopt(m_handle,CURLOPT_CONNECTTIMEOUT,timeout)==CURLE_OK);
}
-
+
bool setTimeout(long timeout) {
return (curl_easy_setopt(m_handle,CURLOPT_TIMEOUT,timeout)==CURLE_OK);
}
-
+
bool setAuth(transport_auth_t authType, const char* username=NULL, const char* password=NULL);
-
+
bool setVerifyHost(bool verify) {
return (curl_easy_setopt(m_handle,CURLOPT_SSL_VERIFYHOST,verify ? 2 : 0)==CURLE_OK);
}
-
+
#ifndef XMLTOOLING_NO_XMLSEC
bool setCredential(const Credential* cred=NULL) {
const OpenSSLCredential* down = dynamic_cast<const OpenSSLCredential*>(cred);
@@ -119,7 +119,7 @@ namespace xmltooling {
m_cred = down;
return true;
}
-
+
bool setTrustEngine(
const X509TrustEngine* trustEngine=NULL,
const CredentialResolver* peerResolver=NULL,
@@ -139,9 +139,9 @@ namespace xmltooling {
m_mandatory = mandatory;
return true;
}
-
+
#endif
-
+
bool useChunkedEncoding(bool chunked=true) {
m_chunked = chunked;
return true;
@@ -165,13 +165,13 @@ namespace xmltooling {
return (curl_easy_setopt(m_handle, opt, value) == CURLE_OK);
#endif
}
-
+
void send(istream& in);
-
+
istream& receive() {
return m_stream;
}
-
+
bool isAuthenticated() const {
return m_authenticated;
}
@@ -181,23 +181,23 @@ namespace xmltooling {
}
string getContentType() const;
-
+
bool setRequestHeader(const char* name, const char* val) {
string temp(name);
temp=temp + ": " + val;
m_headers=curl_slist_append(m_headers,temp.c_str());
return true;
}
-
+
const vector<string>& getResponseHeader(const char* val) const;
-
+
bool setSSLCallback(ssl_ctx_callback_fn fn, void* userptr=NULL) {
m_ssl_callback=fn;
m_ssl_userptr=userptr;
return true;
}
- private:
+ private:
// per-call state
string m_sender,m_peerName,m_endpoint,m_simplecreds;
CURL* m_handle;
@@ -215,7 +215,7 @@ namespace xmltooling {
void* m_ssl_userptr;
bool m_chunked;
bool m_authenticated;
-
+
friend size_t XMLTOOL_DLLLOCAL curl_header_hook(void* ptr, size_t size, size_t nmemb, void* stream);
friend CURLcode XMLTOOL_DLLLOCAL xml_ssl_ctx_callback(CURL* curl, SSL_CTX* ssl_ctx, void* userptr);
friend int XMLTOOL_DLLLOCAL verify_callback(X509_STORE_CTX* x509_ctx, void* arg);
@@ -277,12 +277,12 @@ CURL* CURLPool::get(const SOAPTransport::Address& addr)
key = key + '|' + addr.m_to;
m_lock->lock();
poolmap_t::iterator i=m_bindingMap.find(key);
-
+
if (i!=m_bindingMap.end()) {
// Move this pool to the front of the list.
m_pools.remove(&(i->second));
m_pools.push_front(&(i->second));
-
+
// If a free connection exists, return it.
if (!(i->second.empty())) {
CURL* handle=i->second.back();
@@ -293,10 +293,10 @@ CURL* CURLPool::get(const SOAPTransport::Address& addr)
return handle;
}
}
-
+
m_lock->unlock();
m_log.debug("nothing free in pool, returning new connection handle");
-
+
// Create a new connection and set non-varying options.
CURL* handle=curl_easy_init();
if (!handle)
@@ -328,7 +328,7 @@ void CURLPool::put(const char* from, const char* to, const char* endpoint, CURL*
m_pools.push_front(&(m_bindingMap.insert(poolmap_t::value_type(key,vector<CURL*>(1,handle))).first->second));
else
i->second.push_back(handle);
-
+
CURL* killit=NULL;
if (++m_size > 256) {
// Kick a handle out from the back of the bus.
@@ -340,7 +340,7 @@ void CURLPool::put(const char* from, const char* to, const char* endpoint, CURL*
m_size--;
break;
}
-
+
// Move an empty pool up to the front so we don't keep hitting it.
m_pools.pop_back();
m_pools.push_front(corpse);
@@ -384,7 +384,7 @@ const vector<string>& CURLSOAPTransport::getResponseHeader(const char* name) con
map<string,vector<string> >::const_iterator i=m_response_headers.find(name);
if (i!=m_response_headers.end())
return i->second;
-
+
for (map<string,vector<string> >::const_iterator j=m_response_headers.begin(); j!=m_response_headers.end(); j++) {
#ifdef HAVE_STRCASECMP
if (!strcasecmp(j->first.c_str(), name))
@@ -393,7 +393,7 @@ const vector<string>& CURLSOAPTransport::getResponseHeader(const char* name) con
#endif
return j->second;
}
-
+
return emptyVector;
}
@@ -412,6 +412,10 @@ void CURLSOAPTransport::send(istream& in)
Category& log=Category::getInstance(XMLTOOLING_LOGCAT".SOAPTransport.CURL");
Category& log_curl=Category::getInstance(XMLTOOLING_LOGCAT".libcurl");
+ // For this implementation, it's sufficient to check for https as a sign of transport security.
+ if (m_mandatory && !isConfidential())
+ throw IOException("Blocking unprotected HTTP request, transport authentication by server required.");
+
string msg;
// By this time, the handle has been prepared with the URL to use and the
@@ -420,22 +424,26 @@ void CURLSOAPTransport::send(istream& in)
// Setup standard per-call curl properties.
curl_easy_setopt(m_handle,CURLOPT_DEBUGDATA,&log_curl);
curl_easy_setopt(m_handle,CURLOPT_FILE,&m_stream);
- curl_easy_setopt(m_handle,CURLOPT_POST,1);
- if (m_chunked) {
+ if (m_chunked && in) {
+ curl_easy_setopt(m_handle,CURLOPT_POST,1);
m_headers=curl_slist_append(m_headers,"Transfer-Encoding: chunked");
curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,&curl_read_hook);
curl_easy_setopt(m_handle,CURLOPT_READDATA,&in);
}
- else {
+ else if (in) {
char buf[1024];
while (in) {
in.read(buf,1024);
msg.append(buf,in.gcount());
}
+ curl_easy_setopt(m_handle,CURLOPT_POST,1);
curl_easy_setopt(m_handle,CURLOPT_READFUNCTION,NULL);
curl_easy_setopt(m_handle,CURLOPT_POSTFIELDS,msg.c_str());
curl_easy_setopt(m_handle,CURLOPT_POSTFIELDSIZE,msg.length());
}
+ else {
+ curl_easy_setopt(m_handle,CURLOPT_HTTPGET,1);
+ }
char curl_errorbuf[CURL_ERROR_SIZE];
curl_errorbuf[0]=0;
@@ -465,7 +473,7 @@ void CURLSOAPTransport::send(istream& in)
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_FUNCTION,NULL);
curl_easy_setopt(m_handle,CURLOPT_SSL_CTX_DATA,NULL);
}
-
+
// Make the call.
log.debug("sending SOAP message to %s", m_endpoint.c_str());
if (curl_easy_perform(m_handle) != CURLE_OK) {
@@ -562,14 +570,14 @@ int xmltooling::verify_callback(X509_STORE_CTX* x509_ctx, void* arg)
cc.setUsage(Credential::TLS_CREDENTIAL);
success = ctx->m_trustEngine->validate(x509_ctx->cert,x509_ctx->untrusted,*(ctx->m_peerResolver),&cc);
}
-
+
if (!success) {
log.error("supplied TrustEngine failed to validate SSL/TLS server certificate");
x509_ctx->error=X509_V_ERR_APPLICATION_VERIFICATION; // generic error, check log for plugin specifics
ctx->setAuthenticated(false);
return ctx->m_mandatory ? 0 : 1;
}
-
+
// Signal success. Hopefully it doesn't matter what's actually in the structure now.
ctx->setAuthenticated(true);
return 1;
@@ -599,9 +607,9 @@ CURLcode xmltooling::xml_ssl_ctx_callback(CURL* curl, SSL_CTX* ssl_ctx, void* us
#endif
}
#endif
-
+
if (conf->m_ssl_callback && !conf->m_ssl_callback(conf, ssl_ctx, conf->m_ssl_userptr))
return CURLE_SSL_CERTPROBLEM;
-
+
return CURLE_OK;
}
diff --git a/xmltooling/soap/impl/SOAPClient.cpp b/xmltooling/soap/impl/SOAPClient.cpp
index 91215b5..e89742b 100644
--- a/xmltooling/soap/impl/SOAPClient.cpp
+++ b/xmltooling/soap/impl/SOAPClient.cpp
@@ -90,9 +90,13 @@ Envelope* SOAPClient::receive()
Category& log = Category::getInstance(XMLTOOLING_LOGCAT".SOAPClient");
if (log.isDebugEnabled()) {
- string serializedXml;
- XMLHelper::serialize (doc->getDocumentElement(),serializedXml,false);
- log.debugStream() << "received XML:\n" << serializedXml << logging::eol;
+#ifdef XMLTOOLING_LOG4SHIB
+ log.debugStream() << "received XML:\n" << *(doc->getDocumentElement()) << logging::eol;
+#else
+ string buf;
+ XMLHelper::serialize(doc->getDocumentElement(), buf);
+ log.debugStream() << "received XML:\n" << buf << logging::eol;
+#endif
}
auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
diff --git a/xmltooling/util/CurlURLInputStream.cpp b/xmltooling/util/CurlURLInputStream.cpp
index 03d86f2..532d318 100644
--- a/xmltooling/util/CurlURLInputStream.cpp
+++ b/xmltooling/util/CurlURLInputStream.cpp
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,15 +21,7 @@
#include "internal.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-//#include <sys/types.h>
-//#include <sys/time.h>
+#include <curl/curl.h>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/XMLNetAccessor.hpp>
@@ -47,219 +39,98 @@ using namespace xmltooling;
CurlURLInputStream::CurlURLInputStream(const XMLURL& urlSource, const XMLNetHTTPInfo* httpInfo/*=0*/)
- : fMulti(0)
- , fEasy(0)
- , fMemoryManager(urlSource.getMemoryManager())
+ : fMemoryManager(urlSource.getMemoryManager())
, fURLSource(urlSource)
, fURL(0)
- , fTotalBytesRead(0)
- , fWritePtr(0)
- , fBytesRead(0)
- , fBytesToRead(0)
- , fDataAvailable(false)
- , fBufferHeadPtr(fBuffer)
- , fBufferTailPtr(fBuffer)
+ , fInputStream(NULL)
, m_log(logging::Category::getInstance(XMLTOOLING_LOGCAT".libcurl.NetAccessor"))
{
- // Allocate the curl multi handle
- fMulti = curl_multi_init();
-
- // Allocate the curl easy handle
- fEasy = curl_easy_init();
-
// Get the text of the URL we're going to use
fURL.reset(XMLString::transcode(fURLSource.getURLText(), fMemoryManager), fMemoryManager);
-
- m_log.debug("libcurl trying to fetch %s", fURL.get());
-
- // Set URL option
- curl_easy_setopt(fEasy, CURLOPT_URL, fURL.get());
- curl_easy_setopt(fEasy, CURLOPT_WRITEDATA, this); // Pass this pointer to write function
- curl_easy_setopt(fEasy, CURLOPT_WRITEFUNCTION, staticWriteCallback); // Our static write function
- curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT, 30);
- curl_easy_setopt(fEasy, CURLOPT_TIMEOUT, 60);
- curl_easy_setopt(fEasy, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
- curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYHOST, 0);
- curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYPEER, 0);
- curl_easy_setopt(fEasy, CURLOPT_NOPROGRESS, 1);
- curl_easy_setopt(fEasy, CURLOPT_NOSIGNAL, 1);
- curl_easy_setopt(fEasy, CURLOPT_FAILONERROR, 1);
-
- // Add easy handle to the multi stack
- curl_multi_add_handle(fMulti, fEasy);
}
CurlURLInputStream::~CurlURLInputStream()
{
- // Remove the easy handle from the multi stack
- curl_multi_remove_handle(fMulti, fEasy);
-
- // Cleanup the easy handle
- curl_easy_cleanup(fEasy);
-
- // Cleanup the multi handle
- curl_multi_cleanup(fMulti);
+ delete fInputStream;
}
-size_t
-CurlURLInputStream::staticWriteCallback(char *buffer,
- size_t size,
- size_t nitems,
- void *outstream)
+size_t CurlURLInputStream::staticWriteCallback(void* ptr, size_t size, size_t nmemb, void* stream)
{
- return ((CurlURLInputStream*)outstream)->writeCallback(buffer, size, nitems);
+ size_t len = size*nmemb;
+ reinterpret_cast<std::stringstream*>(stream)->write(reinterpret_cast<const char*>(ptr),len);
+ return len;
}
-
-size_t
-CurlURLInputStream::writeCallback(char *buffer,
- size_t size,
- size_t nitems)
+unsigned int CurlURLInputStream::readBytes(XMLByte* const toFill, const unsigned int maxToRead)
{
- size_t cnt = size * nitems;
- size_t totalConsumed = 0;
-
- // Consume as many bytes as possible immediately into the buffer
- size_t consume = (cnt > fBytesToRead) ? fBytesToRead : cnt;
- memcpy(fWritePtr, buffer, consume);
- fWritePtr += consume;
- fBytesRead += consume;
- fTotalBytesRead += consume;
- fBytesToRead -= consume;
-
- //m_log.debug("write callback consuming %d bytes", consume);
+ if (!fInputStream) {
+ // Allocate the curl easy handle.
+ CURL* fEasy = curl_easy_init();
+ if (!fEasy)
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_InternalError, "unable to allocate libcurl handle", fMemoryManager);
+
+ m_log.debug("libcurl trying to fetch %s", fURL.get());
+
+ // Set URL option
+ curl_easy_setopt(fEasy, CURLOPT_URL, fURL.get());
+ curl_easy_setopt(fEasy, CURLOPT_WRITEDATA, &fUnderlyingStream);
+ curl_easy_setopt(fEasy, CURLOPT_WRITEFUNCTION, staticWriteCallback);
+ curl_easy_setopt(fEasy, CURLOPT_CONNECTTIMEOUT, 30);
+ curl_easy_setopt(fEasy, CURLOPT_TIMEOUT, 60);
+ curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_easy_setopt(fEasy, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(fEasy, CURLOPT_NOPROGRESS, 1);
+ curl_easy_setopt(fEasy, CURLOPT_NOSIGNAL, 1);
+ curl_easy_setopt(fEasy, CURLOPT_FAILONERROR, 1);
+
+ char curl_errorbuf[CURL_ERROR_SIZE];
+ curl_errorbuf[0]=0;
+ curl_easy_setopt(fEasy,CURLOPT_ERRORBUFFER,curl_errorbuf);
+
+ // Fetch the data.
+ if (curl_easy_perform(fEasy) != CURLE_OK) {
+ curl_easy_cleanup(fEasy);
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_InternalError, curl_errorbuf, fMemoryManager);
+ }
- // If bytes remain, rebuffer as many as possible into our holding buffer
- buffer += consume;
- totalConsumed += consume;
- cnt -= consume;
- if (cnt > 0)
- {
- size_t bufAvail = sizeof(fBuffer) - (fBufferHeadPtr - fBuffer);
- consume = (cnt > bufAvail) ? bufAvail : cnt;
- memcpy(fBufferHeadPtr, buffer, consume);
- fBufferHeadPtr += consume;
- buffer += consume;
- totalConsumed += consume;
- //m_log.debug("write callback rebuffering %d bytes", consume);
- }
-
- // Return the total amount we've consumed. If we don't consume all the bytes
- // then an error will be generated. Since our buffer size is equal to the
- // maximum size that curl will write, this should never happen unless there
- // is a logic error somewhere here.
- return totalConsumed;
-}
+ curl_easy_cleanup(fEasy);
+ /*
+ switch (msg->data.result)
+ {
+ case CURLE_OK:
+ // We completed successfully. runningHandles should have dropped to zero, so we'll bail out below...
+ break;
-unsigned int
-CurlURLInputStream::readBytes(XMLByte* const toFill
- , const unsigned int maxToRead)
-{
- fBytesRead = 0;
- fBytesToRead = maxToRead;
- fWritePtr = toFill;
-
- for (bool tryAgain = true; fBytesToRead > 0 && (tryAgain || fBytesRead == 0); )
- {
- // First, any buffered data we have available
- size_t bufCnt = fBufferHeadPtr - fBufferTailPtr;
- bufCnt = (bufCnt > fBytesToRead) ? fBytesToRead : bufCnt;
- if (bufCnt > 0)
- {
- memcpy(fWritePtr, fBufferTailPtr, bufCnt);
- fWritePtr += bufCnt;
- fBytesRead += bufCnt;
- fTotalBytesRead += bufCnt;
- fBytesToRead -= bufCnt;
-
- fBufferTailPtr += bufCnt;
- if (fBufferTailPtr == fBufferHeadPtr)
- fBufferHeadPtr = fBufferTailPtr = fBuffer;
-
- //m_log.debug("consuming %d buffered bytes", bufCnt);
+ case CURLE_UNSUPPORTED_PROTOCOL:
+ ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_UnsupportedProto, fMemoryManager);
+ break;
- tryAgain = true;
- continue;
- }
-
- // Ask the curl to do some work
- int runningHandles = 0;
- CURLMcode curlResult = curl_multi_perform(fMulti, &runningHandles);
- //m_log.debug("curl_multi_perform returned %d", curlResult);
- tryAgain = (curlResult == CURLM_CALL_MULTI_PERFORM);
-
- // Process messages from curl
- int msgsInQueue = 0;
- for (CURLMsg* msg = NULL; (msg = curl_multi_info_read(fMulti, &msgsInQueue)) != NULL; )
- {
- m_log.debug("msg %d, %d from curl", msg->msg, msg->data.result);
+ case CURLE_COULDNT_RESOLVE_HOST:
+ case CURLE_COULDNT_RESOLVE_PROXY:
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_TargetResolution, fURLSource.getHost(), fMemoryManager);
+ break;
- if (msg->msg != CURLMSG_DONE)
- continue;
-
- switch (msg->data.result)
- {
- case CURLE_OK:
- // We completed successfully. runningHandles should have dropped to zero, so we'll bail out below...
- break;
-
- case CURLE_UNSUPPORTED_PROTOCOL:
- ThrowXMLwithMemMgr(MalformedURLException, XMLExcepts::URL_UnsupportedProto, fMemoryManager);
- break;
+ case CURLE_COULDNT_CONNECT:
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_ConnSocket, fURLSource.getURLText(), fMemoryManager);
- case CURLE_COULDNT_RESOLVE_HOST:
- case CURLE_COULDNT_RESOLVE_PROXY:
- ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_TargetResolution, fURLSource.getHost(), fMemoryManager);
- break;
-
- case CURLE_COULDNT_CONNECT:
- ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_ConnSocket, fURLSource.getURLText(), fMemoryManager);
-
- case CURLE_RECV_ERROR:
- ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_ReadSocket, fURLSource.getURLText(), fMemoryManager);
- break;
+ case CURLE_RECV_ERROR:
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_ReadSocket, fURLSource.getURLText(), fMemoryManager);
+ break;
- default:
- m_log.error("curl NetAccessor encountered error from libcurl (%d)", msg->data.result);
- ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_InternalError, fURLSource.getURLText(), fMemoryManager);
- break;
- }
- }
-
- // If nothing is running any longer, bail out
- if (runningHandles == 0) {
- //m_log.debug("libcurl indicated no running handles");
- break;
+ default:
+ m_log.error("curl NetAccessor encountered error from libcurl (%d)", msg->data.result);
+ ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_InternalError, fURLSource.getURLText(), fMemoryManager);
+ break;
}
-
- // If there is no further data to read, and we haven't
- // read any yet on this invocation, call select to wait for data
- if (!tryAgain && fBytesRead == 0)
- {
- fd_set readSet;
- fd_set writeSet;
- fd_set exceptSet;
- int fdcnt=0;
-
- // Ask curl for the file descriptors to wait on
- FD_ZERO(&readSet);
- FD_ZERO(&writeSet);
- FD_ZERO(&exceptSet);
- (void) curl_multi_fdset(fMulti, &readSet, &writeSet, &exceptSet, &fdcnt);
-
- // Wait on the file descriptors
- timeval tv;
- tv.tv_sec = 2;
- tv.tv_usec = 0;
- (void) select(fdcnt+1, &readSet, &writeSet, &exceptSet, &tv);
- }
- }
-
- //m_log.debug("returning with %d bytes to parser", fBytesRead);
- return fBytesRead;
-}
+ */
+ fInputStream = new (fMemoryManager) StreamInputSource::StreamBinInputStream(fUnderlyingStream);
+ }
+
+ // Defer to the stream wrapper.
+ return fInputStream->readBytes(toFill, maxToRead);
+}
diff --git a/xmltooling/util/CurlURLInputStream.hpp b/xmltooling/util/CurlURLInputStream.hpp
index 991f775..cd6106a 100644
--- a/xmltooling/util/CurlURLInputStream.hpp
+++ b/xmltooling/util/CurlURLInputStream.hpp
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,10 +23,9 @@
#define XERCESC_INCLUDE_GUARD_CURLURLINPUTSTREAM_HPP
#include <xmltooling/logging.h>
+#include <xmltooling/util/ParserPool.h>
-#include <curl/curl.h>
-#include <curl/multi.h>
-#include <curl/easy.h>
+#include <sstream>
#include <xercesc/util/XMLURL.hpp>
#include <xercesc/util/XMLExceptMsgs.hpp>
@@ -48,12 +47,7 @@ public :
~CurlURLInputStream();
unsigned int curPos() const;
- unsigned int readBytes
- (
- XMLByte* const toFill
- , const unsigned int maxToRead
- );
-
+ unsigned int readBytes(XMLByte* const toFill, const unsigned int maxToRead);
private :
// -----------------------------------------------------------------------
@@ -61,65 +55,24 @@ private :
// -----------------------------------------------------------------------
CurlURLInputStream(const CurlURLInputStream&);
CurlURLInputStream& operator=(const CurlURLInputStream&);
-
- static size_t staticWriteCallback(char *buffer,
- size_t size,
- size_t nitems,
- void *outstream);
- size_t writeCallback( char *buffer,
- size_t size,
- size_t nitems);
+ static size_t staticWriteCallback(void* ptr, size_t size, size_t nmemb, void* stream);
- // -----------------------------------------------------------------------
- // Private data members
- //
- // fSocket
- // The socket representing the connection to the remote file.
- // fBytesProcessed
- // Its a rolling count of the number of bytes processed off this
- // input stream.
- // fBuffer
- // Holds the http header, plus the first part of the actual
- // data. Filled at the time the stream is opened, data goes
- // out to user in response to readBytes().
- // fBufferPos, fBufferEnd
- // Pointers into fBuffer, showing start and end+1 of content
- // that readBytes must return.
- // -----------------------------------------------------------------------
-
- CURLM* fMulti;
- CURL* fEasy;
-
+ std::stringstream fUnderlyingStream;
MemoryManager* fMemoryManager;
-
XMLURL fURLSource;
ArrayJanitor<char> fURL;
-
- unsigned long fTotalBytesRead;
- XMLByte* fWritePtr;
- unsigned long fBytesRead;
- unsigned long fBytesToRead;
- bool fDataAvailable;
-
- // Overflow buffer for when curl writes more data to us
- // than we've asked for.
- XMLByte fBuffer[CURL_MAX_WRITE_SIZE];
- XMLByte* fBufferHeadPtr;
- XMLByte* fBufferTailPtr;
-
+ StreamInputSource::StreamBinInputStream* fInputStream;
logging::Category& m_log;
-
+
}; // CurlURLInputStream
-inline unsigned int
-CurlURLInputStream::curPos() const
+inline unsigned int CurlURLInputStream::curPos() const
{
- return fTotalBytesRead;
+ return fInputStream ? fInputStream->curPos() : 0;
}
};
#endif // CURLURLINPUTSTREAM_HPP
-
diff --git a/xmltooling/util/PathResolver.cpp b/xmltooling/util/PathResolver.cpp
index f894d2f..f4d4975 100644
--- a/xmltooling/util/PathResolver.cpp
+++ b/xmltooling/util/PathResolver.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* 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
@@ -16,8 +16,8 @@
/**
* PathResolver.cpp
- *
- * Resolves local filenames into absolute pathnames.
+ *
+ * Resolves local filenames into absolute pathnames.
*/
#include "internal.h"
@@ -32,9 +32,15 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char*
if (!isAbsolute(s.c_str())) {
switch (filetype) {
case XMLTOOLING_LIB_FILE:
- s = string(prefix ? prefix : m_defaultPrefix) + "/lib/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
+ s = string(prefix ? prefix : m_defaultPrefix) +
+#if (SIZEOF_LONG == 8)
+ "/lib64/"
+#else
+ "/lib/"
+#endif
+ + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
break;
-
+
case XMLTOOLING_LOG_FILE:
if (prefix || m_defaultPrefix != "/usr")
s = string(prefix ? prefix : m_defaultPrefix) + "/var/log/" + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
@@ -59,7 +65,7 @@ const string& PathResolver::resolve(string& s, file_type_t filetype, const char*
else
s = string("/etc/") + (pkgname ? pkgname : m_defaultPackage) + '/' + s;
break;
-
+
default:
throw XMLToolingException("Unknown file type to resolve.");
}
diff --git a/xmltooling/util/Win32Threads.cpp b/xmltooling/util/Win32Threads.cpp
new file mode 100644
index 0000000..3bf6419
--- /dev/null
+++ b/xmltooling/util/Win32Threads.cpp
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2001-2007 Internet2
+ *
+ * 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.
+ */
+
+/**
+ * Win32Threads.cpp
+ *
+ * Thread and locking wrappers for Win32 platforms
+ */
+
+#include "internal.h"
+#include "logging.h"
+#include "util/Threads.h"
+
+#ifndef WIN32
+# error "This implementation is for WIN32 platforms."
+#endif
+
+using namespace xmltooling::logging;
+using namespace xmltooling;
+using namespace std;
+
+// base error code for a routine to return on failure
+#define THREAD_ERROR_TIMEOUT (1)
+#define THREAD_ERROR_WAKE_OTHER (2)
+#define THREAD_ERROR (3)
+
+// windows returns non zero for success pthreads returns zero
+static int XMLTOOL_DLLLOCAL map_windows_error_status_to_pthreads(int rc=0) {
+ if(rc!=0) // success?
+ return 0;
+ Category::getInstance(XMLTOOLING_LOGCAT".Threads").error("error from thread operation (%d)", GetLastError());
+ return THREAD_ERROR;
+}
+
+namespace xmltooling {
+
+ // two levels of classes are needed here
+ // in case InitializeCriticalSection
+ // throws an exception we can keep from
+ // calling the critical_section destructor
+ // on unitilized data, or it could be done with a flag
+ struct XMLTOOL_DLLLOCAL critical_section_data {
+ CRITICAL_SECTION cs;
+ critical_section_data(){
+ InitializeCriticalSection(&cs);
+ }
+ };
+
+ class XMLTOOL_DLLLOCAL critical_section {
+ private:
+ critical_section_data cse;
+ public:
+ critical_section(){}
+ ~critical_section(){
+ DeleteCriticalSection (&cse.cs);
+ }
+ void enter(void) {
+ EnterCriticalSection(&cse.cs);
+ }
+ void leave(void) {
+ LeaveCriticalSection(&cse.cs);
+ }
+ };
+
+ // hold a critical section over the lifetime of this object
+ // used to make a stack variable that unlocks automaticly
+ // on return/throw
+ class XMLTOOL_DLLLOCAL with_crit_section {
+ private:
+ critical_section& cs;
+ public:
+ with_crit_section(critical_section& acs):cs(acs){
+ cs.enter();
+ }
+ ~with_crit_section(){
+ cs.leave();
+ }
+ };
+
+ class XMLTOOL_DLLLOCAL ThreadImpl : public Thread {
+ private:
+ HANDLE thread_id;
+ public:
+ ThreadImpl(void* (*start_routine)(void*), void* arg) : thread_id(0) {
+ thread_id=CreateThread(
+ 0, // security attributes
+ 0, // use default stack size, maybe this should be setable
+ (LPTHREAD_START_ROUTINE ) start_routine,
+ arg,
+ 0, // flags, default is ignore stacksize and don't create suspended which is what we want
+ 0);
+ if (thread_id==0) {
+ map_windows_error_status_to_pthreads();
+ throw ThreadingException("Thread creation failed.");
+ }
+ }
+
+ ~ThreadImpl() {
+ (void)detach();
+ }
+
+ int detach() {
+ if (thread_id==0)
+ return THREAD_ERROR;
+ int rc=map_windows_error_status_to_pthreads(CloseHandle(thread_id));
+ thread_id=0;
+ return rc;
+ }
+
+ int join(void** thread_return) {
+ if (thread_id==0)
+ return THREAD_ERROR;
+ if (thread_return!=0)
+ *thread_return=0;
+ int rc=WaitForSingleObject(thread_id,INFINITE);
+ switch(rc) {
+ case WAIT_OBJECT_0:
+ if (thread_return)
+ map_windows_error_status_to_pthreads(GetExitCodeThread(thread_id,(unsigned long*)thread_return));
+ default:
+ return THREAD_ERROR;
+ }
+ return 0;
+ }
+
+ int kill(int signo) {
+ if (thread_id==0)
+ return THREAD_ERROR;
+ return map_windows_error_status_to_pthreads(TerminateThread(thread_id,signo));
+ }
+ };
+
+ class XMLTOOL_DLLLOCAL MutexImpl : public Mutex {
+ private:
+ HANDLE mhandle;
+ public:
+ MutexImpl() : mhandle(CreateMutex(0,false,0)) {
+ if (mhandle==0) {
+ map_windows_error_status_to_pthreads();
+ throw ThreadingException("Mutex creation failed.");
+ }
+ }
+
+ ~MutexImpl() {
+ if((mhandle!=0) && (!CloseHandle(mhandle)))
+ map_windows_error_status_to_pthreads();
+ }
+
+ int lock() {
+ int rc=WaitForSingleObject(mhandle,INFINITE);
+ switch(rc) {
+ case WAIT_ABANDONED:
+ case WAIT_OBJECT_0:
+ return 0;
+ default:
+ return map_windows_error_status_to_pthreads();
+ }
+ }
+
+ int unlock() {
+ return map_windows_error_status_to_pthreads(ReleaseMutex(mhandle));
+ }
+ };
+
+ class XMLTOOL_DLLLOCAL CondWaitImpl : public CondWait {
+ private:
+ HANDLE cond;
+
+ public:
+ CondWaitImpl() : cond(CreateEvent(0,false,false,0)) {
+ if(cond==0) {
+ map_windows_error_status_to_pthreads();
+ throw ThreadingException("Event creation failed.");
+ }
+ };
+
+ ~CondWaitImpl() {
+ if((cond!=0) && (!CloseHandle(cond)))
+ map_windows_error_status_to_pthreads();
+ }
+
+ int wait(Mutex* mutex) {
+ return timedwait(mutex,INFINITE);
+ }
+
+ int signal() {
+ if(!SetEvent(cond))
+ return map_windows_error_status_to_pthreads();
+ return 0;
+ }
+
+ int broadcast() {
+ throw ThreadingException("Broadcast not implemented on Win32 platforms.");
+ }
+
+ // wait for myself to signal and this mutex or the timeout
+ int timedwait(Mutex* mutex, int delay_seconds) {
+ int rc=mutex->unlock();
+ if(rc!=0)
+ return rc;
+
+ int delay_ms=delay_seconds;
+ if(delay_seconds!=INFINITE)
+ delay_ms*=1000;
+ rc=WaitForSingleObject(cond,delay_ms);
+ int rc2=mutex->lock();
+ if(rc2!=0)
+ return rc2;
+ switch(rc) {
+ case WAIT_ABANDONED:
+ case WAIT_OBJECT_0:
+ case WAIT_TIMEOUT:
+ return 0;
+ default:
+ return map_windows_error_status_to_pthreads();
+ }
+ return 0;
+ }
+ };
+
+ class XMLTOOL_DLLLOCAL RWLockImpl : public RWLock {
+ private:
+ // used to protect read or write to the data below
+ critical_section cs;
+ // event handle threads wait on when the lock they want is busy
+ // normally set to signaled all the time, if some thread can't get what
+ // they want they reset it and sleep. on releasing a lock set it to
+ // signaled if someone may have wanted what you just released
+ HANDLE wake_waiters;
+ // number of threads holding a read lock
+ int num_readers;
+ // true iff there a writer has our lock
+ bool have_writer;
+
+ public:
+ RWLockImpl() : wake_waiters(0), num_readers(0), have_writer(true) {
+ with_crit_section acs(cs);
+ wake_waiters=CreateEvent(0,true,true,0);
+ have_writer=false;
+ if (wake_waiters==0) {
+ map_windows_error_status_to_pthreads();
+ throw ThreadingException("Event creation for shared lock failed.");
+ }
+ }
+
+ ~RWLockImpl() {
+ with_crit_section acs(cs);
+ if ((wake_waiters!=0) && (!CloseHandle(wake_waiters)))
+ map_windows_error_status_to_pthreads();
+ }
+
+ int rdlock() {
+ while(1) {
+ // wait for the lock maybe being availible
+ // we will find out for sure inside the critical section
+ if (WaitForSingleObject(wake_waiters,INFINITE)!=WAIT_OBJECT_0)
+ return map_windows_error_status_to_pthreads();
+
+ with_crit_section alock(cs);
+ // invariant not locked for reading and writing
+ if ((num_readers!=0) && (have_writer))
+ return THREAD_ERROR;
+ // if no writer we can join any existing readers
+ if (!have_writer) {
+ num_readers++;
+ return 0;
+ }
+
+ // have a writer, mark the synchronization object
+ // so everyone waits, when the writer unlocks it will wake us
+ if (!ResetEvent(wake_waiters))
+ return map_windows_error_status_to_pthreads();
+ }
+ return THREAD_ERROR;
+ }
+
+ int wrlock() {
+ while(1) {
+ // wait for the lock maybe being availible
+ // we will find out for sure inside the critical section
+ if (WaitForSingleObject(wake_waiters,INFINITE)!=WAIT_OBJECT_0)
+ return map_windows_error_status_to_pthreads();
+
+ with_crit_section bla(cs);
+ // invariant not locked for reading and writing
+ if ((num_readers!=0) && (have_writer))
+ return THREAD_ERROR;
+
+ // if no writer and no readers we can become the writer
+ if ((num_readers==0) && (!have_writer)) {
+ have_writer=true;
+ return 0;
+ }
+
+ // lock is busy, the unlocker will wake us
+ if (!ResetEvent(wake_waiters))
+ return map_windows_error_status_to_pthreads();
+ }
+ return THREAD_ERROR;
+ }
+
+ int unlock() {
+ with_crit_section mumble(cs);
+ // invariant not locked for reading and writing
+ if ((num_readers!=0) && (have_writer))
+ return THREAD_ERROR;
+
+ // error if nothing locked
+ if ((num_readers==0) && (!have_writer))
+ return THREAD_ERROR;
+
+ // if there was a writer it has to be us so unlock write lock
+ have_writer=false;
+
+ // if there where any reades there is one less now
+ if(num_readers>0)
+ num_readers--;
+
+ // if no readers left wake up any readers/writers waiting
+ // to have a go at it
+ if (num_readers==0)
+ if (!SetEvent(wake_waiters))
+ return map_windows_error_status_to_pthreads();
+ return 0;
+ }
+ };
+
+ typedef void (*destroy_hook_type)(void*);
+
+ class XMLTOOL_DLLLOCAL ThreadKeyImpl : public ThreadKey {
+ private:
+ destroy_hook_type destroy_hook;
+ DWORD key;
+
+ public:
+ ThreadKeyImpl(void (*destroy_fcn)(void*)) : destroy_hook(destroy_fcn) {
+ key=TlsAlloc();
+ };
+
+ virtual ~ThreadKeyImpl() {
+ if (destroy_hook)
+ destroy_hook(TlsGetValue(key));
+ TlsFree(key);
+ }
+
+ int setData(void* data) {
+ TlsSetValue(key,data);
+ return 0;
+ }
+
+ void* getData() const {
+ return TlsGetValue(key);
+ }
+ };
+
+};
+
+//
+// public "static" creation functions
+//
+
+Thread* Thread::create(void* (*start_routine)(void*), void* arg)
+{
+ return new ThreadImpl(start_routine, arg);
+}
+
+void Thread::exit(void* return_val)
+{
+ ExitThread((DWORD)return_val);
+}
+
+void Thread::sleep(int seconds)
+{
+ Sleep(seconds * 1000);
+}
+
+Mutex * Mutex::create()
+{
+ return new MutexImpl();
+}
+
+CondWait * CondWait::create()
+{
+ return new CondWaitImpl();
+}
+
+RWLock * RWLock::create()
+{
+ return new RWLockImpl();
+}
+
+ThreadKey* ThreadKey::create (void (*destroy_fcn)(void*))
+{
+ return new ThreadKeyImpl(destroy_fcn);
+}
diff --git a/xmltooling/version.h b/xmltooling/version.h
index 2489800..b4f6957 100644
--- a/xmltooling/version.h
+++ b/xmltooling/version.h
@@ -38,7 +38,7 @@
*/
#define XMLTOOLING_VERSION_MAJOR 1
-#define XMLTOOLING_VERSION_MINOR 0
+#define XMLTOOLING_VERSION_MINOR 1
#define XMLTOOLING_VERSION_REVISION 0
/** DO NOT MODIFY BELOW THIS LINE */
diff --git a/xmltooling/xmltooling-lite.vcproj b/xmltooling/xmltooling-lite.vcproj
index f98c241..d45dc86 100644
--- a/xmltooling/xmltooling-lite.vcproj
+++ b/xmltooling/xmltooling-lite.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -64,7 +67,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib log4shib1D.lib xerces-c_2D.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0D.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
@@ -142,7 +145,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib log4shib1.lib xerces-c_2.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
@@ -175,6 +178,168 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderThrough=""
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;XMLTOOLING_LITE"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1D.lib xerces-c_2D.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;XMLTOOLING_LITE"
+ RuntimeLibrary="2"
+ PrecompiledHeaderThrough=""
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="XMLTOOLING_LITE"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1.lib xerces-c_2.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/xmltooling/xmltooling.rc b/xmltooling/xmltooling.rc
index 4c09635..d1156c5 100644
--- a/xmltooling/xmltooling.rc
+++ b/xmltooling/xmltooling.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 1,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -51,38 +51,38 @@ BEGIN
#else
VALUE "FileDescription", "OpenSAML XMLTooling Library\0"
#endif
- VALUE "FileVersion", "1, 0, 0, 0\0"
+ VALUE "FileVersion", "1, 1, 0, 0\0"
#ifdef XMLTOOLING_LITE
#ifdef _DEBUG
- VALUE "InternalName", "xmltooling-lite1_0D\0"
+ VALUE "InternalName", "xmltooling-lite1_1D\0"
#else
- VALUE "InternalName", "xmltooling-lite1_0\0"
+ VALUE "InternalName", "xmltooling-lite1_1\0"
#endif
#else
#ifdef _DEBUG
- VALUE "InternalName", "xmltooling1_0D\0"
+ VALUE "InternalName", "xmltooling1_1D\0"
#else
- VALUE "InternalName", "xmltooling1_0\0"
+ VALUE "InternalName", "xmltooling1_1\0"
#endif
#endif
- VALUE "LegalCopyright", "Copyright © 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright © 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
#ifdef XMLTOOLING_LITE
#ifdef _DEBUG
- VALUE "OriginalFilename", "xmltooling-lite1_0D.dll\0"
+ VALUE "OriginalFilename", "xmltooling-lite1_1D.dll\0"
#else
- VALUE "OriginalFilename", "xmltooling-lite1_0.dll\0"
+ VALUE "OriginalFilename", "xmltooling-lite1_1.dll\0"
#endif
#else
#ifdef _DEBUG
- VALUE "OriginalFilename", "xmltooling1_0D.dll\0"
+ VALUE "OriginalFilename", "xmltooling1_1D.dll\0"
#else
- VALUE "OriginalFilename", "xmltooling1_0.dll\0"
+ VALUE "OriginalFilename", "xmltooling1_1.dll\0"
#endif
#endif
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "OpenSAML 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "OpenSAML 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/xmltooling/xmltooling.vcproj b/xmltooling/xmltooling.vcproj
index d058b7a..ca39462 100644
--- a/xmltooling/xmltooling.vcproj
+++ b/xmltooling/xmltooling.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -64,7 +67,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib log4shib1D.lib xerces-c_2D.lib xsec_1D.lib libeay32D.lib ssleay32D.lib libcurld_imp.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0D.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
@@ -141,7 +144,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib log4shib1.lib xerces-c_2.lib xsec_1.lib libeay32.lib ssleay32.lib libcurl_imp.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
@@ -174,6 +177,167 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderThrough=""
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1D.lib xerces-c_2D.lib xsec_1D.lib libeay32D.lib ssleay32D.lib libcurld_imp.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""$(SolutionDir)";"$(ProjectDir)""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ RuntimeLibrary="2"
+ PrecompiledHeaderThrough=""
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1.lib xerces-c_2.lib xsec_1.lib libeay32.lib ssleay32.lib libcurl_imp.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/xmltoolingtest/xmltoolingtest.vcproj b/xmltoolingtest/xmltoolingtest.vcproj
index 370349d..7333f5e 100644
--- a/xmltoolingtest/xmltoolingtest.vcproj
+++ b/xmltoolingtest/xmltoolingtest.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -167,6 +170,160 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(SolutionDir)"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib xsec_1D.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(SolutionDir)"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE=1"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib xsec_1.lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -251,6 +408,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\EncryptionTest.h"
@@ -273,6 +448,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\ExceptionTest.h"
@@ -295,6 +488,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\FilesystemCredentialResolverTest.h"
@@ -317,6 +528,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\InlineKeyResolverTest.h"
@@ -339,6 +568,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\KeyInfoTest.h"
@@ -361,6 +608,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\MarshallingTest.h"
@@ -383,6 +648,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\MemoryStorageServiceTest.h"
@@ -405,6 +688,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\SignatureTest.h"
@@ -427,6 +728,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\TemplateEngineTest.h"
@@ -449,6 +768,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\UnmarshallingTest.h"
@@ -471,6 +808,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --part --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\xmltoolingtest.h"
@@ -493,6 +848,24 @@
Outputs=""$(InputName)".cpp"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs="$(InputName).cpp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="perl.exe -w \cxxtest\cxxtestgen.pl --error-printer --have-eh --have-std --abort-on-fail -o "$(InputName)".cpp "$(InputPath)"
"
+ Outputs=""$(InputName)".cpp"
+ />
+ </FileConfiguration>
</File>
</Filter>
<File
--
Debian packaging for XMLTooling-C
More information about the Pkg-shibboleth-devel
mailing list