mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 05:47:57 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
38
components/files/fileops.hpp
Normal file
38
components/files/fileops.hpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#ifndef COMPONENTS_FILES_FILEOPS_HPP
|
||||
#define COMPONENTS_FILES_FILEOPS_HPP
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
namespace Files
|
||||
{
|
||||
|
||||
///\brief Check if a given path is an existing file (not a directory)
|
||||
///\param [in] name - filename
|
||||
bool isFile(const char *name);
|
||||
|
||||
/// A vector of Boost Paths, very handy
|
||||
typedef std::vector<boost::filesystem::path> PathContainer;
|
||||
|
||||
/// Makes a list of files from a directory by taking a boost
|
||||
/// path and a Path Container and adds to the Path container
|
||||
/// all files in the path. It has a recursive option.
|
||||
void FileLister( boost::filesystem::path currentPath, Files::PathContainer& list, bool recursive);
|
||||
|
||||
/// Locates boost path in path container
|
||||
/// returns the path from the container
|
||||
/// that contains the searched path.
|
||||
/// If it's not found it returns and empty path
|
||||
/// Takes care of slashes, backslashes and it has a strict option.
|
||||
boost::filesystem::path FileListLocator (const Files::PathContainer& list, const boost::filesystem::path& toFind,
|
||||
bool strict, bool ignoreExtensions);
|
||||
|
||||
/// Overloaded form of the locator that takes a string and returns a string
|
||||
std::string FileListLocator (const Files::PathContainer& list,const std::string& toFind, bool strict, bool ignoreExtensions);
|
||||
|
||||
}
|
||||
|
||||
#endif /* COMPONENTS_FILES_FILEOPS_HPP */
|
Loading…
Add table
Add a link
Reference in a new issue