diff options
author | David Robillard <d@drobilla.net> | 2011-09-27 22:26:55 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-27 22:26:55 +0000 |
commit | 84ad1bf1317992127aac405feedbfd68c7be6697 (patch) | |
tree | 63884c6150f4b06c3faf2cdc086136fa2fde76da | |
parent | 5ea6caf8ec6e06b71f14e4a8ac33b29ada7a1518 (diff) | |
download | sord-84ad1bf1317992127aac405feedbfd68c7be6697.tar.gz sord-84ad1bf1317992127aac405feedbfd68c7be6697.tar.bz2 sord-84ad1bf1317992127aac405feedbfd68c7be6697.zip |
Add function sord_write_iter for writing a queried range.
git-svn-id: http://svn.drobilla.net/sord/trunk@162 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | sord/sord.h | 10 | ||||
-rw-r--r-- | src/syntax.c | 12 | ||||
-rw-r--r-- | wscript | 2 |
4 files changed, 24 insertions, 1 deletions
@@ -1,6 +1,7 @@ sord (UNRELEASED) unstable; urgency=low * Add function sord_contains for checking for a triple pattern + * Add function sord_write_iter for writing a queried range * Fix Sord::Namespaces::qualify to no longer chop prefixes * Add ability to build static library diff --git a/sord/sord.h b/sord/sord.h index f76bc0e..d380da2 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -462,6 +462,16 @@ sord_write(SordModel* model, SordNode* graph); /** + Write a range to a writer. + + This increments @c iter to its end, then frees it. +*/ +SORD_API +bool +sord_write_iter(SordIter* iter, + SerdWriter* writer); + +/** @} @} */ diff --git a/src/syntax.c b/src/syntax.c index 93e1331..ac87ad4 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -181,6 +181,18 @@ sord_write(SordModel* model, { SordQuad pat = { 0, 0, 0, graph }; SordIter* iter = sord_find(model, pat); + return sord_write_iter(iter, writer); +} + +bool +sord_write_iter(SordIter* iter, + SerdWriter* writer) +{ + if (!iter) { + return false; + } + + SordModel* model = (SordModel*)sord_iter_get_model(iter); for (; !sord_iter_end(iter); sord_iter_next(iter)) { SordQuad tup; sord_iter_get(iter, tup); @@ -6,7 +6,7 @@ from waflib.extras import autowaf as autowaf import waflib.Logs as Logs, waflib.Options as Options # Version of this package (even if built as a child) -SORD_VERSION = '0.4.3' +SORD_VERSION = '0.5.0' SORD_MAJOR_VERSION = '0' # Library version (UNIX style major, minor, micro) |