diff options
Diffstat (limited to 'src/TurtleWriter.cpp')
-rw-r--r-- | src/TurtleWriter.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/TurtleWriter.cpp b/src/TurtleWriter.cpp index 07e06afe..e19c14e2 100644 --- a/src/TurtleWriter.cpp +++ b/src/TurtleWriter.cpp @@ -14,10 +14,15 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#include "ingen/TurtleWriter.hpp" +#include <ingen/TurtleWriter.hpp> -#include "ingen/URIMap.hpp" -#include "lv2/atom/atom.h" +#include <ingen/AtomWriter.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIMap.hpp> +#include <ingen/ingen.h> +#include <lv2/atom/atom.h> +#include <serd/serd.h> +#include <sratom/sratom.h> #include <utility> @@ -40,20 +45,18 @@ write_prefix(void* handle, const SerdNode* name, const SerdNode* uri) } TurtleWriter::TurtleWriter(URIMap& map, URIs& uris, URI uri) - : AtomWriter(map, uris, *this) - , _map(map) - , _sratom(sratom_new(&map.urid_map())) - , _base(SERD_NODE_NULL) - , _base_uri(SERD_URI_NULL) - , _uri(std::move(uri)) - , _wrote_prefixes(false) + : AtomWriter{map, uris, *this} + , _map{map} + , _sratom{sratom_new(&map.urid_map())} + , _base{serd_node_from_string(SERD_URI, USTR("ingen:/"))} + , _env{serd_env_new(&_base)} + , _uri{std::move(uri)} { // Use <ingen:/> as base URI, so relative URIs are like bundle paths - _base = serd_node_from_string(SERD_URI, USTR("ingen:/")); - serd_uri_parse(_base.buf, &_base_uri); + + serd_uri_parse(USTR("ingen:/"), &_base_uri); // Set up serialisation environment - _env = serd_env_new(&_base); serd_env_set_prefix_from_strings(_env, USTR("atom"), USTR("http://lv2plug.in/ns/ext/atom#")); serd_env_set_prefix_from_strings(_env, USTR("doap"), USTR("http://usefulinc.com/ns/doap#")); serd_env_set_prefix_from_strings(_env, USTR("ingen"), USTR(INGEN_NS)); @@ -66,6 +69,7 @@ TurtleWriter::TurtleWriter(URIMap& map, URIs& uris, URI uri) serd_env_set_prefix_from_strings(_env, USTR("xsd"), USTR("http://www.w3.org/2001/XMLSchema#")); // Make a Turtle writer that writes to text_sink + // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer) _writer = serd_writer_new( SERD_TURTLE, static_cast<SerdStyle>(SERD_STYLE_RESOLVED|SERD_STYLE_ABBREVIATED|SERD_STYLE_CURIED), |