diff options
author | David Robillard <d@drobilla.net> | 2007-03-19 23:16:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-03-19 23:16:47 +0000 |
commit | 4ec43482a75b075fd49868d0b4002411e7e62e9a (patch) | |
tree | 02d654e917f7d1e3752631a7d509c640242f20c4 | |
parent | c39b2c29f12c604ed2fd36484a19d176603c589c (diff) | |
download | raul-4ec43482a75b075fd49868d0b4002411e7e62e9a.tar.gz raul-4ec43482a75b075fd49868d0b4002411e7e62e9a.tar.bz2 raul-4ec43482a75b075fd49868d0b4002411e7e62e9a.zip |
Learn quantization.
RDF serialziation to a C FILE*.
Machina graph drawing improvements.
git-svn-id: http://svn.drobilla.net/lad/raul@364 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | raul/RDFWriter.h | 1 | ||||
-rw-r--r-- | src/RDFWriter.cpp | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/raul/RDFWriter.h b/raul/RDFWriter.h index 9a5d5b3..1cbccaa 100644 --- a/raul/RDFWriter.h +++ b/raul/RDFWriter.h @@ -52,6 +52,7 @@ public: void add_prefix(const std::string& prefix, const std::string& uri); std::string expand_uri(const std::string& uri); + void start_to_file_handle(FILE* fd) throw (std::logic_error); void start_to_filename(const std::string& filename) throw (std::logic_error); void start_to_string() throw (std::logic_error); std::string finish() throw (std::logic_error); diff --git a/src/RDFWriter.cpp b/src/RDFWriter.cpp index f2d5626..6a69765 100644 --- a/src/RDFWriter.cpp +++ b/src/RDFWriter.cpp @@ -84,6 +84,23 @@ RDFWriter::blank_id() } +/** Begin a serialization to a C file handle. + * + * This must be called before any write methods. + */ +void +RDFWriter::start_to_file_handle(FILE* fd) throw (std::logic_error) +{ + if (_serializer) + throw std::logic_error("start_to_string called with serialization in progress"); + + raptor_init(); + _serializer = raptor_new_serializer(RDF_LANG); + raptor_serialize_start_to_file_handle(_serializer, NULL, fd); + setup_prefixes(); +} + + /** Begin a serialization to a file. * * This must be called before any write methods. |