X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ffile_system.hpp;h=9c14bac0a072ad489d14cd5d35debaba31d82e01;hb=8a598e8d635ee4d629371493fef50826a38cd20d;hp=47f86f4a36fcbbaffda04e88609c7247722d1e8a;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/file_system.hpp b/src/file_system.hpp index 47f86f4a3..9c14bac0a 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,17 @@ 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" + */ + std::string normalize(const std::string& filename); } #endif