summaryrefslogtreecommitdiffstats
path: root/src/uri.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uri.cpp')
-rw-r--r--src/uri.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/uri.cpp b/src/uri.cpp
index de6a454ec..8d0e49139 100644
--- a/src/uri.cpp
+++ b/src/uri.cpp
@@ -10,7 +10,9 @@
#include <glib.h>
#include "uri.h"
+#include <string>
#include <glibmm/ustring.h>
+#include <glibmm/miscutils.h>
namespace Inkscape {
@@ -134,6 +136,17 @@ gchar *URI::to_native_filename(gchar const* uri) throw(BadURIException)
return filename;
}
+const std::string URI::getFullPath(std::string const base) const {
+ std::string path = std::string(_impl->getPath());
+ // Calculate the absolute path from an available base
+ if(!path.empty() && !base.empty() && path.compare(0, 1, "/") != 0) {
+ path = Glib::build_filename(base, path);
+ }
+ // TODO: Check existance of file here
+ return path;
+}
+
+
/* TODO !!! proper error handling */
gchar *URI::toNativeFilename() const throw(BadURIException) {
gchar *uriString = toString();