[Liblas-commits] hg-main-tree: remove redundant definition for
ORACLE
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed May 25 11:01:03 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/d3d11c032f66
changeset: 726:d3d11c032f66
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 09:45:26 2011 -0500
description:
remove redundant definition for ORACLE
Subject: hg-main-tree: rename write() method to getXML()
details: http://hg.libpc.orghg-main-tree/rev/145a2808afc1
changeset: 727:145a2808afc1
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 09:59:52 2011 -0500
description:
rename write() method to getXML()
Subject: hg-main-tree: Schema::from_xml and Schema::to_xml static methods for ingesting and producing XML descriptions of Schema objects
details: http://hg.libpc.orghg-main-tree/rev/32629e4225cb
changeset: 728:32629e4225cb
user: Howard Butler <hobu.inc at gmail.com>
date: Wed May 25 10:00:54 2011 -0500
description:
Schema::from_xml and Schema::to_xml static methods for ingesting and producing XML descriptions of Schema objects
diffstat:
CMakeLists.txt | 1 -
include/libpc/Schema.hpp | 5 +++--
include/libpc/XMLSchema.hpp | 2 +-
src/Schema.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++--
src/XMLSchema.cpp | 3 +--
5 files changed, 48 insertions(+), 8 deletions(-)
diffs (120 lines):
diff -r 67f95ecb3aed -r 32629e4225cb CMakeLists.txt
--- a/CMakeLists.txt Tue May 24 16:27:10 2011 -0500
+++ b/CMakeLists.txt Wed May 25 10:00:54 2011 -0500
@@ -305,7 +305,6 @@
if(ORACLE_FOUND)
include_directories(${ORACLE_INCLUDE_DIR})
- add_definitions(-DHAVE_ORACLE=1)
set(LIBPC_HAVE_ORACLE 1)
endif()
endif()
diff -r 67f95ecb3aed -r 32629e4225cb include/libpc/Schema.hpp
--- a/include/libpc/Schema.hpp Tue May 24 16:27:10 2011 -0500
+++ b/include/libpc/Schema.hpp Wed May 25 10:00:54 2011 -0500
@@ -94,8 +94,9 @@
void dump() const;
- static Schema from_xml(std::istream* stream);
- static std::ostream* to_xml(Schema const& schema);
+ static Schema from_xml(std::string const& xml, std::string const& xsd);
+ static Schema from_xml(std::string const& xml);
+ static std::string to_xml(Schema const& schema);
private:
std::vector<Dimension> m_dimensions;
diff -r 67f95ecb3aed -r 32629e4225cb include/libpc/XMLSchema.hpp
--- a/include/libpc/XMLSchema.hpp Tue May 24 16:27:10 2011 -0500
+++ b/include/libpc/XMLSchema.hpp Wed May 25 10:00:54 2011 -0500
@@ -180,7 +180,7 @@
Writer(libpc::Schema const& schema);
~Writer() {};
- std::string write();
+ std::string getXML();
protected:
diff -r 67f95ecb3aed -r 32629e4225cb src/Schema.cpp
--- a/src/Schema.cpp Tue May 24 16:27:10 2011 -0500
+++ b/src/Schema.cpp Wed May 25 10:00:54 2011 -0500
@@ -45,6 +45,10 @@
#include <libpc/exceptions.hpp>
+#ifdef LIBPC_HAVE_LIBXML2
+#include <libpc/XMLSchema.hpp>
+#endif
+
namespace libpc
{
@@ -264,9 +268,46 @@
return os;
}
-Schema Schema::from_xml(std::istream* stream)
+
+#ifdef LIBPC_HAVE_LIBXML2
+
+
+#endif
+
+
+Schema Schema::from_xml(std::string const& xml, std::string const& xsd)
{
- return Schema();
+#ifdef LIBPC_HAVE_LIBXML2
+
+ libpc::schema::Reader reader(xml, xsd);
+
+ libpc::Schema schema = reader.getSchema();
+
+#endif
+}
+
+Schema Schema::from_xml(std::string const& xml)
+{
+#ifdef LIBPC_HAVE_LIBXML2
+
+ std::string xsd("");
+
+ libpc::schema::Reader reader(xml, xsd);
+
+ libpc::Schema schema = reader.getSchema();
+
+#endif
+}
+
+std::string Schema::to_xml(Schema const& schema)
+{
+#ifdef LIBPC_HAVE_LIBXML2
+
+ libpc::schema::Writer writer(schema);
+
+ return writer.getXML();
+
+#endif
}
} // namespace libpc
diff -r 67f95ecb3aed -r 32629e4225cb src/XMLSchema.cpp
--- a/src/XMLSchema.cpp Tue May 24 16:27:10 2011 -0500
+++ b/src/XMLSchema.cpp Wed May 25 10:00:54 2011 -0500
@@ -646,14 +646,13 @@
Writer::Writer(libpc::Schema const& schema)
: m_schema(schema) {}
-std::string Writer::write()
+std::string Writer::getXML()
{
BufferPtr buffer = BufferPtr(xmlBufferCreate(), BufferDeleter());
xmlBufferPtr b = static_cast<xmlBuffer*>(buffer.get());
TextWriterPtr writer = TextWriterPtr(xmlNewTextWriterMemory(b, 0), WriterDeleter());
-
write(writer);
xmlTextWriterPtr w = static_cast<xmlTextWriterPtr>(writer.get());
More information about the Liblas-commits
mailing list