From 44f7ad5222d824d81dc743045d5887418847e74e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jan 2018 00:41:34 +0100 Subject: Add URI class and remove use of Raul::URI --- src/AtomReader.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/AtomReader.cpp') diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp index 5aa39657..218110e4 100644 --- a/src/AtomReader.cpp +++ b/src/AtomReader.cpp @@ -64,44 +64,44 @@ AtomReader::get_props(const LV2_Atom_Object* obj, LV2_ATOM_OBJECT_FOREACH(obj, p) { Atom val; get_atom(&p->value, val); - props.emplace(Raul::URI(_map.unmap_uri(p->key)), val); + props.emplace(URI(_map.unmap_uri(p->key)), val); } } -boost::optional +boost::optional AtomReader::atom_to_uri(const LV2_Atom* atom) { if (!atom) { - return boost::optional(); + return boost::optional(); } else if (atom->type == _uris.atom_URI) { const char* str = (const char*)LV2_ATOM_BODY_CONST(atom); - if (Raul::URI::is_valid(str)) { - return Raul::URI(str); + if (URI::is_valid(str)) { + return URI(str); } else { _log.warn(fmt("Invalid URI <%1%>\n") % str); } } else if (atom->type == _uris.atom_Path) { const char* str = (const char*)LV2_ATOM_BODY_CONST(atom); if (!strncmp(str, "file://", 5)) { - return Raul::URI(str); + return URI(str); } else { - return Raul::URI(std::string("file://") + str); + return URI(std::string("file://") + str); } } else if (atom->type == _uris.atom_URID) { const char* str = _map.unmap_uri(((const LV2_Atom_URID*)atom)->body); if (str) { - return Raul::URI(str); + return URI(str); } else { _log.warn(fmt("Unknown URID %1%\n") % str); } } - return boost::optional(); + return boost::optional(); } boost::optional AtomReader::atom_to_path(const LV2_Atom* atom) { - boost::optional uri = atom_to_uri(atom); + boost::optional uri = atom_to_uri(atom); if (uri && uri_is_path(*uri)) { return uri_to_path(*uri); } @@ -113,7 +113,7 @@ AtomReader::atom_to_context(const LV2_Atom* atom) { Resource::Graph ctx = Resource::Graph::DEFAULT; if (atom) { - boost::optional maybe_uri = atom_to_uri(atom); + boost::optional maybe_uri = atom_to_uri(atom); if (maybe_uri) { ctx = Resource::uri_to_graph(*maybe_uri); } else { @@ -158,7 +158,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id) (LV2_URID)_uris.patch_sequenceNumber, &number, NULL); - const boost::optional subject_uri = atom_to_uri(subject); + const boost::optional subject_uri = atom_to_uri(subject); const int32_t seq = ((number && number->type == _uris.atom_Int) ? ((const LV2_Atom_Int*)number)->body @@ -267,7 +267,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id) get_atom(value, atom); _iface(SetProperty{seq, *subject_uri, - Raul::URI(_map.unmap_uri(prop->body)), + URI(_map.unmap_uri(prop->body)), atom, atom_to_context(context)}); } else if (obj->body.otype == _uris.patch_Patch) { @@ -313,13 +313,13 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id) return false; } - boost::optional subject_uri(atom_to_uri(subject)); + boost::optional subject_uri(atom_to_uri(subject)); if (!subject_uri) { _log.warn("Copy message has non-path subject\n"); return false; } - boost::optional dest_uri(atom_to_uri(dest)); + boost::optional dest_uri(atom_to_uri(dest)); if (!dest_uri) { _log.warn("Copy message has non-URI destination\n"); return false; -- cgit v1.2.1