summaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-02-27 23:49:20 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-02-27 23:49:20 +0000
commit6c5b23c3d3eff317c770c52cf47ca9955be7caba (patch)
tree91f6b3f9d70089226ef546a9c9a9580c7e59d4d2 /src/io
parentgseal fix (diff)
parentfixed crash! (diff)
downloadinkscape-6c5b23c3d3eff317c770c52cf47ca9955be7caba.tar.gz
inkscape-6c5b23c3d3eff317c770c52cf47ca9955be7caba.zip
Merge Andrew's new OCAL dialog and clean headers. Please test
(bzr r11027)
Diffstat (limited to 'src/io')
-rw-r--r--src/io/sys.cpp9
-rw-r--r--src/io/sys.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/io/sys.cpp b/src/io/sys.cpp
index e83861237..5f19ee5db 100644
--- a/src/io/sys.cpp
+++ b/src/io/sys.cpp
@@ -355,6 +355,15 @@ gchar* Inkscape::IO::sanitizeString( gchar const * str )
return result;
}
+/*
+ * Returns the file extension of a path/filename
+ */
+Glib::ustring Inkscape::IO::get_file_extension(Glib::ustring path)
+{
+ Glib::ustring::size_type period_location = path.find_last_of(".");
+ return path.substr(period_location);
+}
+
/*
Local Variables:
mode:c++
diff --git a/src/io/sys.h b/src/io/sys.h
index 83ffdb41c..fbfe4d4c4 100644
--- a/src/io/sys.h
+++ b/src/io/sys.h
@@ -59,6 +59,8 @@ void spawn_async_with_pipes (const std::string& working_directory,
int* standard_output,
int* standard_error);
+Glib::ustring get_file_extension(Glib::ustring path);
+
}
}