summaryrefslogtreecommitdiffstats
path: root/src/uri.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-01-25 01:05:26 +0000
committerMartin Owens <doctormo@gmail.com>2014-01-25 01:05:26 +0000
commitddb8af8009f151c7107daf0c2127f0ba2d882649 (patch)
tree7ce918b452da5860dee2f5fd5926e28a1907c71b /src/uri.cpp
parentfixed user description of VS command (diff)
downloadinkscape-ddb8af8009f151c7107daf0c2127f0ba2d882649.tar.gz
inkscape-ddb8af8009f151c7107daf0c2127f0ba2d882649.zip
Move absolute path generator to URI and use std::strings
(bzr r12977)
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();