summaryrefslogtreecommitdiffstats
path: root/ingen/URI.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-21 00:41:34 +0100
committerDavid Robillard <d@drobilla.net>2018-01-21 00:56:50 +0100
commita99b72e4adbc4c28fadc08d29299d99405f72db9 (patch)
treefb21f2cea8f5db1dc187cdbdd01f43e73bbddfff /ingen/URI.hpp
parent329f498d901f9be9c0c820749850f5277a17df5d (diff)
downloadingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.tar.gz
ingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.tar.bz2
ingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.zip
Add FilePath class and remove use of glib path utilities
Diffstat (limited to 'ingen/URI.hpp')
-rw-r--r--ingen/URI.hpp6
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; }