X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ffile_system.hpp;h=b8211884c201984a0723bc1072b37c8248ea1f7f;hb=43db9a6c44b6ee544e7694d1bb234ba559b0849c;hp=2241904852e4d43ab34a4f7220adc36d6f91799e;hpb=eb40ead9684fd22440c6deeaaf5c3408eead208a;p=supertux.git diff --git a/src/file_system.hpp b/src/file_system.hpp index 224190485..b8211884c 100644 --- a/src/file_system.hpp +++ b/src/file_system.hpp @@ -1,3 +1,22 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2006 Matthias Braun +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + #ifndef __FILESYSTEM_H__ #define __FILESYSTEM_H__ @@ -8,6 +27,12 @@ namespace FileSystem { std::string dirname(const std::string& filename); std::string basename(const std::string& filename); + + /** + * remove everything starting from and including the last dot + */ + std::string strip_extension(const std::string& filename); + /** * normalize filename so that "blup/bla/blo/../../bar" will become * "blup/bar" @@ -16,4 +41,3 @@ namespace FileSystem } #endif -