diff options
author | David Robillard <d@drobilla.net> | 2018-01-21 00:41:34 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-01-21 00:56:50 +0100 |
commit | 44f7ad5222d824d81dc743045d5887418847e74e (patch) | |
tree | 1b41535ac00b8b225a25dba2873b064cb074bfa9 /ingen/paths.hpp | |
parent | 90fca083052880479ad90d870e556f0648e32106 (diff) | |
download | ingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.gz ingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.bz2 ingen-44f7ad5222d824d81dc743045d5887418847e74e.zip |
Add URI class and remove use of Raul::URI
Diffstat (limited to 'ingen/paths.hpp')
-rw-r--r-- | ingen/paths.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ingen/paths.hpp b/ingen/paths.hpp index 3269a2ab..e75e71e0 100644 --- a/ingen/paths.hpp +++ b/ingen/paths.hpp @@ -20,33 +20,34 @@ #include <cstddef> #include <string> -#include "raul/URI.hpp" +#include "ingen/URI.hpp" #include "raul/Path.hpp" namespace Ingen { -inline Raul::URI main_uri() { return Raul::URI("ingen:/main"); } +inline URI main_uri() { return URI("ingen:/main"); } -inline bool uri_is_path(const Raul::URI& uri) +inline bool uri_is_path(const URI& uri) { - const size_t root_len = main_uri().length(); + const size_t root_len = main_uri().string().length(); if (uri == main_uri()) { return true; } else { - return uri.substr(0, root_len + 1) == main_uri() + "/"; + return uri.string().substr(0, root_len + 1) == + main_uri().string() + "/"; } } -inline Raul::Path uri_to_path(const Raul::URI& uri) +inline Raul::Path uri_to_path(const URI& uri) { return (uri == main_uri()) ? Raul::Path("/") - : Raul::Path(uri.substr(main_uri().length())); + : Raul::Path(uri.string().substr(main_uri().string().length())); } -inline Raul::URI path_to_uri(const Raul::Path& path) +inline URI path_to_uri(const Raul::Path& path) { - return Raul::URI(main_uri() + path.c_str()); + return URI(main_uri().string() + path.c_str()); } } // namespace Ingen |