From: Abdelrazak Younes Date: Mon, 22 Sep 2008 09:44:44 +0000 (+0000) Subject: add FileName::extension() method. X-Git-Tag: 1.6.10~3381 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c0aeb567ce6f98f94e85943e2be5cdeb0c3ea2a7;p=lyx.git add FileName::extension() method. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26494 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 5e1ae84b90..d87ab63f4b 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -302,6 +302,12 @@ string FileName::onlyFileNameWithoutExt() const } +string FileName::extension() const +{ + return fromqstr(d->fi.suffix()); +} + + FileName FileName::onlyPath() const { FileName path; diff --git a/src/support/FileName.h b/src/support/FileName.h index 0b65eb1f25..1c020c898f 100644 --- a/src/support/FileName.h +++ b/src/support/FileName.h @@ -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