[Liblas-commits] hg-main-tree: actually return the schema objects
in from_xml
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed May 25 11:29:09 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/2945d3a96cd9
changeset: 729:2945d3a96cd9
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 10:26:33 2011 -0500
description:
actually return the schema objects in from_xml
Subject: hg-main-tree: use new getXML() rename instead of write()
details: http://hg.libpc.orghg-main-tree/rev/79075278c18f
changeset: 730:79075278c18f
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 10:28:30 2011 -0500
description:
use new getXML() rename instead of write()
Subject: hg-main-tree: write the stage's xml schema if we weren't given an override
details: http://hg.libpc.orghg-main-tree/rev/7089c623ac1b
changeset: 731:7089c623ac1b
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 10:28:58 2011 -0500
description:
write the stage's xml schema if we weren't given an override
diffstat:
src/Schema.cpp | 2 ++
src/drivers/oci/Writer.cpp | 17 +++++++++++------
test/unit/XMLSchemaTest.cpp | 2 +-
3 files changed, 14 insertions(+), 7 deletions(-)
diffs (62 lines):
diff -r 32629e4225cb -r 7089c623ac1b src/Schema.cpp
--- a/src/Schema.cpp Wed May 25 10:00:54 2011 -0500
+++ b/src/Schema.cpp Wed May 25 10:28:58 2011 -0500
@@ -282,6 +282,7 @@
libpc::schema::Reader reader(xml, xsd);
libpc::Schema schema = reader.getSchema();
+ return schema;
#endif
}
@@ -295,6 +296,7 @@
libpc::schema::Reader reader(xml, xsd);
libpc::Schema schema = reader.getSchema();
+ return schema;
#endif
}
diff -r 32629e4225cb -r 7089c623ac1b src/drivers/oci/Writer.cpp
--- a/src/drivers/oci/Writer.cpp Wed May 25 10:00:54 2011 -0500
+++ b/src/drivers/oci/Writer.cpp Wed May 25 10:28:58 2011 -0500
@@ -636,16 +636,21 @@
OCILobLocator* schema_locator ;
OCILobLocator* boundary_locator ;
+ std::string schema_data;
if (bHaveSchemaOverride)
{
- std::string schema_data = ReadFile(point_schema_override);
- char* schema = (char*) malloc(schema_data.size() * sizeof(char) + 1);
- strncpy(schema, schema_data.c_str(), schema_data.size());
- schema[schema_data.size()] = '\0';
- statement->WriteCLob( &schema_locator, schema );
- statement->Bind(&schema_locator);
+ schema_data = ReadFile(point_schema_override);
+ } else {
+ schema_data = libpc::Schema::to_xml(m_stage.getSchema());
}
+ char* schema = (char*) malloc(schema_data.size() * sizeof(char) + 1);
+ strncpy(schema, schema_data.c_str(), schema_data.size());
+ schema[schema_data.size()] = '\0';
+ statement->WriteCLob( &schema_locator, schema );
+ statement->Bind(&schema_locator);
+
+
// if (header_data->size() != 0)
// {
// OCILobLocator** locator =(OCILobLocator**) VSIMalloc( sizeof(OCILobLocator*) * 1 );
diff -r 32629e4225cb -r 7089c623ac1b test/unit/XMLSchemaTest.cpp
--- a/test/unit/XMLSchemaTest.cpp Wed May 25 10:00:54 2011 -0500
+++ b/test/unit/XMLSchemaTest.cpp Wed May 25 10:28:58 2011 -0500
@@ -103,7 +103,7 @@
libpc::Schema schema = reader.getSchema();
libpc::schema::Writer writer(schema);
- std::string xml_output = writer.write();
+ std::string xml_output = writer.getXML();
libpc::schema::Reader reader2(xml_output, xsd);
libpc::Schema schema2 = reader2.getSchema();
More information about the Liblas-commits
mailing list