]> git.lyx.org Git - features.git/commitdiff
add FileName::extension() method.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 22 Sep 2008 09:44:44 +0000 (09:44 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 22 Sep 2008 09:44:44 +0000 (09:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26494 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/FileName.cpp
src/support/FileName.h

index 5e1ae84b90b56b573637d6eaa6478b19a8a9e392..d87ab63f4bd36876fd3dcd18d8556593a82b0f37 100644 (file)
@@ -302,6 +302,12 @@ string FileName::onlyFileNameWithoutExt() const
 }
 
 
+string FileName::extension() const
+{
+       return fromqstr(d->fi.suffix());
+}
+
+
 FileName FileName::onlyPath() const
 {
        FileName path;
index 0b65eb1f2558f6d41db6f879f3ac1d87edf1449b..1c020c898f18d7e8760907d7bd3c870129ac2354 100644 (file)
@@ -170,8 +170,10 @@ public:
 
        /// filename without path
        std::string onlyFileName() const;
-        /// filename without path and without extension
-        std::string onlyFileNameWithoutExt() const;
+       /// filename without path and without extension
+       std::string onlyFileNameWithoutExt() const;
+       /// only extension after the last dot.
+       std::string extension() const;
        /// path without file name
        FileName onlyPath() const;
        /// used for display in the Gui