FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
vfsdirectory.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_VFS_VFSHOSTSYSTEM_H
23 #define FIFE_VFS_VFSHOSTSYSTEM_H
24 
25 // Standard C++ library includes
26 
27 // 3rd party library includes
28 
29 // FIFE includes
30 // These includes are split up in two parts, separated by one empty line
31 // First block: files included from the FIFE root src directory
32 // Second block: files included from the same folder
33 #include "vfssource.h"
34 
35 namespace FIFE {
36 
44  class VFSDirectory : public VFSSource {
45  public:
50  VFSDirectory(VFS* vfs, const std::string& root = "./");
53  virtual ~VFSDirectory();
54 
59  virtual bool fileExists(const std::string& filename) const;
63  virtual RawData* open(const std::string& filename) const;
64 
70  std::set<std::string> listFiles(const std::string& path) const;
71 
77  std::set<std::string> listDirectories(const std::string& path) const;
78 
79  private:
80  std::string m_root;
81 
82  std::set<std::string> list(const std::string& path, bool directorys) const;
83 
84  };
85 
86 }
87 
88 #endif
VFSDirectory(VFS *vfs, const std::string &root="./")
Constructor Creates the given file system&#39;s VFS Source, Uses boost_filesystem to achieve Plattform in...
VFSSource abstract baseclass.
Definition: vfssource.h:46
virtual RawData * open(const std::string &filename) const
Opens a file.
virtual bool fileExists(const std::string &filename) const
Tests whether a file can be opened.
std::set< std::string > list(const std::string &path, bool directorys) const
std::set< std::string > listFiles(const std::string &path) const
List files in a directory.
std::string m_root
Definition: vfsdirectory.h:80
virtual ~VFSDirectory()
Destructor.
std::set< std::string > listDirectories(const std::string &path) const
List directories in a directory.
the main VFS (virtual file system) class
Definition: vfs.h:58
The most basic VFSSource for "normal" filesystems.
Definition: vfsdirectory.h:44
Used to access diffrent kinds of data.
Definition: rawdata.h:48