[xsd-users] Streaming and Xerces-C++ runtime initialization
Yury Zaytsev
yury.zaytsev at traveltainment.de
Tue Mar 10 06:58:29 EDT 2015
Hi Boris,
On Mon, 16 Feb 2015, Boris Kolpackov wrote:
> Yury Zaytsev <yury.zaytsev at traveltainment.de> writes:
>
>> While we are at it, do you happen have any plans for inclusion of the
>> serializer in the standard XSD runtime rather than keeping it as an example
>> only? For now, I've hacked up a patch to convert it to use unique_ptr<>,
>> which I can post if it would help, and included it directly in my
>> project. However, since I include the runtime anyways, it would be easier
>> maintenance-wise rather than checking whether anything has changed with
>> every new version, and applying custom patches on top, etc.
>
> The example started with a parser and serializer that had to be customized
> for each vocabulary. Now, however, that they were generalized, I agree it
> would make sense to move them to libxsd. There is one problem, though:
> libxsd is header-only and both of them, and especially the serializer,
> have quite a bit of non-inline source code. So that's an obstacle.
As promised, please find a patch for C++11 support in serializer attached.
I think that it's a bit cleaner than the other one that is already
floating around; at least I've tried my best to stick to your coding
conventions...
For now I'm simply adding the objects to my build system and compile them
with -DXSD_CXX11 (honestly, I haven't actually tried to compile the
auto_ptr version, but hopefully it should work).
You are right about the non-inline code, but as far as I understand, if
you want to keep the implementations separate for maintenance purposes,
then you can simply rename the *.cxx file to *.ixx and include it from the
*.hxx file, whereas the static const XMLCh arrays can be wrapped around
with static get_XXX() member functions in order to avoid linking problems.
Hope that helps,
--
Dr. Yury V. Zaytsev
Senior Software Developer
IT Data Production
TravelTainment GmbH
Carlo-Schmid-Straße 12
52146 Würselen/Aachen, Germany
yury.zaytsev at traveltainment.de
http://www.traveltainment.de
Amtsgericht Aachen, HRB 15873
Geschäftsführer: Bernhard Steffens (Vorsitzender),
Dr. Oliver Rengelshausen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serializer-c++11.patch
Type: text/x-diff
Size: 7727 bytes
Desc: serializer-c++11.patch
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20150310/a0fb0277/serializer-c11.bin
More information about the xsd-users
mailing list