From 002481162f050709a125e38dc60145ef77c10c98 Mon Sep 17 00:00:00 2001 From: "Andrew rugby471@gmail.com" <> Date: Thu, 24 Mar 2011 19:14:21 +0000 Subject: Made dialog's state persistant Cleanup of code Made download of image work Put all images into a /tmp/openclipart directory Use GUID for filename (bzr r10092.1.18) --- src/io/sys.cpp | 9 +++++++++ src/io/sys.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'src/io') diff --git a/src/io/sys.cpp b/src/io/sys.cpp index a68d02707..e7fdfaa2d 100644 --- a/src/io/sys.cpp +++ b/src/io/sys.cpp @@ -365,6 +365,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 8623f6be9..8ece3b84a 100644 --- a/src/io/sys.h +++ b/src/io/sys.h @@ -61,6 +61,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); + } } -- cgit v1.2.3