summaryrefslogtreecommitdiff
path: root/dist/examples/cxx/tree/streaming
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-13 11:29:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-13 11:29:26 +0200
commitafebd79d44b75aed3b38e867c65330ba80ddc0ee (patch)
tree7fc95caae113884defce1ac712f93327f58f72e0 /dist/examples/cxx/tree/streaming
parent0b21758fcd9f3127e30a1c9172c4c27b46a2b957 (diff)
Extended the streaming example
It now shows how to perform stream-oriented, partially in-memory XML processing using the C++/Tree mapping.
Diffstat (limited to 'dist/examples/cxx/tree/streaming')
-rw-r--r--dist/examples/cxx/tree/streaming/makefile18
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-7.1.vcproj30
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-8.0.vcproj42
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-9.0.vcproj42
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-xerces2-7.1.vcproj30
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-xerces2-8.0.vcproj42
-rw-r--r--dist/examples/cxx/tree/streaming/streaming-xerces2-9.0.vcproj42
7 files changed, 160 insertions, 86 deletions
diff --git a/dist/examples/cxx/tree/streaming/makefile b/dist/examples/cxx/tree/streaming/makefile
index 40d2dd6..ed32b83 100644
--- a/dist/examples/cxx/tree/streaming/makefile
+++ b/dist/examples/cxx/tree/streaming/makefile
@@ -4,28 +4,30 @@ include $(root)/build/cxx/rules.make
include $(root)/build/xsd/tree-rules.make
-override XSDFLAGS += --generate-serialization --suppress-parsing --root-element-all
+override XSDFLAGS += --generate-serialization
# Build.
#
-driver: driver.o records.o
+driver: driver.o parser.o serializer.o position.o
-records.o: records.cxx records.hxx
-driver.o: driver.cxx records.hxx
+position.o: position.cxx position.hxx
+driver.o: driver.cxx position.hxx parser.hxx serializer.hxx
+parser.o: parser.cxx parser.hxx
+serializer.o: serializer.cxx serializer.hxx
-records.cxx records.hxx: records.xsd
+position.cxx position.hxx: position.xsd
# Test
#
.PHONY: test
-test: driver
- ./driver
+test: driver position.xml
+ ./driver position.xml
# Clean.
#
.PHONY: clean
clean:
- rm -f records.o records.?xx driver.o driver out.xml
+ rm -f position.o position.?xx parser.o serializer.o driver.o driver out.xml
diff --git a/dist/examples/cxx/tree/streaming/streaming-7.1.vcproj b/dist/examples/cxx/tree/streaming/streaming-7.1.vcproj
index aeaf847..7a11fe9 100644
--- a/dist/examples/cxx/tree/streaming/streaming-7.1.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-7.1.vcproj
@@ -121,7 +121,13 @@
RelativePath=".\driver.cxx">
</File>
<File
- RelativePath=".\records.cxx">
+ RelativePath=".\position.cxx">
+ </File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
</File>
</Filter>
<Filter
@@ -129,29 +135,35 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}">
<File
- RelativePath=".\records.hxx">
+ RelativePath=".\position.hxx">
+ </File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
</File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd">
<File
- RelativePath=".\records.xsd">
+ RelativePath=".\position.xsd">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"/>
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"/>
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"/>
</FileConfiguration>
</File>
</Filter>
diff --git a/dist/examples/cxx/tree/streaming/streaming-8.0.vcproj b/dist/examples/cxx/tree/streaming/streaming-8.0.vcproj
index 05e19b9..b7f65d0 100644
--- a/dist/examples/cxx/tree/streaming/streaming-8.0.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-8.0.vcproj
@@ -350,9 +350,15 @@
>
</File>
<File
- RelativePath=".\records.cxx"
+ RelativePath=".\position.cxx"
>
</File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -360,25 +366,31 @@
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}"
>
<File
- RelativePath=".\records.hxx"
+ RelativePath=".\position.hxx"
>
</File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
+ </File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd"
>
<File
- RelativePath=".\records.xsd"
+ RelativePath=".\position.xsd"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -386,9 +398,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -396,9 +408,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -406,9 +418,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
</File>
diff --git a/dist/examples/cxx/tree/streaming/streaming-9.0.vcproj b/dist/examples/cxx/tree/streaming/streaming-9.0.vcproj
index c5560dc..cbfec59 100644
--- a/dist/examples/cxx/tree/streaming/streaming-9.0.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-9.0.vcproj
@@ -347,9 +347,15 @@
>
</File>
<File
- RelativePath=".\records.cxx"
+ RelativePath=".\position.cxx"
>
</File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -357,25 +363,31 @@
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}"
>
<File
- RelativePath=".\records.hxx"
+ RelativePath=".\position.hxx"
>
</File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
+ </File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd"
>
<File
- RelativePath=".\records.xsd"
+ RelativePath=".\position.xsd"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -383,9 +395,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -393,9 +405,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -403,9 +415,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
</File>
diff --git a/dist/examples/cxx/tree/streaming/streaming-xerces2-7.1.vcproj b/dist/examples/cxx/tree/streaming/streaming-xerces2-7.1.vcproj
index 9785c61..b606b8f 100644
--- a/dist/examples/cxx/tree/streaming/streaming-xerces2-7.1.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-xerces2-7.1.vcproj
@@ -121,7 +121,13 @@
RelativePath=".\driver.cxx">
</File>
<File
- RelativePath=".\records.cxx">
+ RelativePath=".\position.cxx">
+ </File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
</File>
</Filter>
<Filter
@@ -129,29 +135,35 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}">
<File
- RelativePath=".\records.hxx">
+ RelativePath=".\position.hxx">
+ </File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
</File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd">
<File
- RelativePath=".\records.xsd">
+ RelativePath=".\position.xsd">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"/>
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"/>
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"/>
</FileConfiguration>
</File>
</Filter>
diff --git a/dist/examples/cxx/tree/streaming/streaming-xerces2-8.0.vcproj b/dist/examples/cxx/tree/streaming/streaming-xerces2-8.0.vcproj
index 2008048..fbd555e 100644
--- a/dist/examples/cxx/tree/streaming/streaming-xerces2-8.0.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-xerces2-8.0.vcproj
@@ -350,9 +350,15 @@
>
</File>
<File
- RelativePath=".\records.cxx"
+ RelativePath=".\position.cxx"
>
</File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -360,25 +366,31 @@
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}"
>
<File
- RelativePath=".\records.hxx"
+ RelativePath=".\position.hxx"
>
</File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
+ </File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd"
>
<File
- RelativePath=".\records.xsd"
+ RelativePath=".\position.xsd"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -386,9 +398,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -396,9 +408,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -406,9 +418,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --generate-intellisense --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization --generate-intellisense position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
</File>
diff --git a/dist/examples/cxx/tree/streaming/streaming-xerces2-9.0.vcproj b/dist/examples/cxx/tree/streaming/streaming-xerces2-9.0.vcproj
index f94a34b..e3da54b 100644
--- a/dist/examples/cxx/tree/streaming/streaming-xerces2-9.0.vcproj
+++ b/dist/examples/cxx/tree/streaming/streaming-xerces2-9.0.vcproj
@@ -347,9 +347,15 @@
>
</File>
<File
- RelativePath=".\records.cxx"
+ RelativePath=".\position.cxx"
>
</File>
+ <File
+ RelativePath=".\parser.cxx">
+ </File>
+ <File
+ RelativePath=".\serializer.cxx">
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -357,25 +363,31 @@
UniqueIdentifier="{94F3375D-5EB8-4D2C-8739-4D47E9AB7072}"
>
<File
- RelativePath=".\records.hxx"
+ RelativePath=".\position.hxx"
>
</File>
+ <File
+ RelativePath=".\parser.hxx">
+ </File>
+ <File
+ RelativePath=".\serializer.hxx">
+ </File>
</Filter>
<Filter
Name="Schema Files"
Filter="xsd"
>
<File
- RelativePath=".\records.xsd"
+ RelativePath=".\position.xsd"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -383,9 +395,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -393,9 +405,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
<FileConfiguration
@@ -403,9 +415,9 @@
>
<Tool
Name="VCCustomBuildTool"
- Description="xsd records.xsd"
- CommandLine="xsd.exe cxx-tree --generate-serialization --suppress-parsing --root-element-all records.xsd"
- Outputs="records.cxx;records.hxx"
+ Description="xsd position.xsd"
+ CommandLine="xsd.exe cxx-tree --generate-serialization position.xsd"
+ Outputs="position.cxx;position.hxx"
/>
</FileConfiguration>
</File>