fife_boost_filesystem.h

00001 /***************************************************************************
00002 *   Copyright (C) 2005-2008 by the FIFE team                              *
00003 *   http://www.fifengine.de                                               *
00004 *   This file is part of FIFE.                                            *
00005 *                                                                         *
00006 *   FIFE is free software; you can redistribute it and/or                 *
00007 *   modify it under the terms of the GNU Lesser General Public            *
00008 *   License as published by the Free Software Foundation; either          *
00009 *   version 2.1 of the License, or (at your option) any later version.    *
00010 *                                                                         *
00011 *   This library is distributed in the hope that it will be useful,       *
00012 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014 *   Lesser General Public License for more details.                       *
00015 *                                                                         *
00016 *   You should have received a copy of the GNU Lesser General Public      *
00017 *   License along with this library; if not, write to the                 *
00018 *   Free Software Foundation, Inc.,                                       *
00019 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
00020 ***************************************************************************/
00021 #ifndef FIFE_VFS_H_
00022 #define FIFE_VFS_H_
00023 
00024 // Standard C++ library includes
00025 
00026 // 3rd party library includes
00027 #include <boost/filesystem.hpp>
00028 // #include <boost/filesystem/operations.hpp>
00029 // #include <boost/filesystem/path.hpp>
00030 
00031 // FIFE includes
00032 // These includes are split up in two parts, separated by one empty line
00033 // First block: files included from the FIFE root src directory
00034 // Second block: files included from the same folder
00035 
00036 namespace bfs = boost::filesystem;
00037 
00038 namespace FIFE {
00039 
00045     bool HasParentPath(const bfs::path& path);
00046 
00051     bfs::path GetParentPath(const bfs::path& path);
00052 
00058     std::string GetFilenameFromPath(const bfs::path& path);
00059 
00064     std::string GetFilenameFromDirectoryIterator(const bfs::directory_iterator& iter);
00065 
00070     std::string GetPathIteratorAsString(const bfs::path::iterator& pathIter);
00071 
00076     bfs::path GetAbsolutePath(const std::string& path);
00077 
00082     bfs::path GetAbsolutePath(const bfs::path& path);
00083 
00088     bool HasExtension(const std::string& path);
00089 
00094     bool HasExtension(const bfs::path& path);
00095 
00101     std::string GetExtension(const std::string& path);
00102 
00108     std::string GetExtension(const bfs::path& path);
00109 
00115     std::string GetStem(const std::string& path);
00116 
00122     std::string GetStem(const bfs::path& path);
00123 }
00124 
00125 #endif