diff options
Diffstat (limited to 'ingen/URI.hpp')
-rw-r--r-- | ingen/URI.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ingen/URI.hpp b/ingen/URI.hpp index 6b2adff4..30aeb7cc 100644 --- a/ingen/URI.hpp +++ b/ingen/URI.hpp @@ -22,6 +22,7 @@ #include <boost/utility/string_view.hpp> +#include "ingen/FilePath.hpp" #include "ingen/ingen.h" #include "serd/serd.h" #include "sord/sordmm.hpp" @@ -38,6 +39,7 @@ public: explicit URI(const char* str); URI(const std::string& str, const URI& base); explicit URI(const Sord::Node& node); + explicit URI(const FilePath& path); URI(const URI& uri); URI& operator=(const URI& uri); @@ -53,6 +55,10 @@ public: size_t length() const { return _node.n_bytes; } const char* c_str() const { return (const char*)_node.buf; } + FilePath file_path() const { + return scheme() == "file" ? FilePath(path()) : FilePath(); + } + operator std::string() const { return string(); } const char* begin() const { return (const char*)_node.buf; } |