Pioneer
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
FileSystem Namespace Reference

Classes

class  FileData
 
class  FileDataMalloc
 
class  FileEnumerator
 
class  FileInfo
 
class  FileSource
 
class  FileSourceFS
 
class  FileSourceUnion
 
class  FileSourceZip
 

Enumerations

enum class  CopyMode { OVERWRITE , ONLY_MISSING_IN_TARGET }
 

Functions

std::string SanitiseFileName (const std::string &a)
 
std::string JoinPath (const std::string &a, const std::string &b)
 
std::string NormalisePath (const std::string &path)
 
std::string JoinPathBelow (const std::string &base, const std::string &path)
 
std::string GetRelativePath (const std::string &base, const std::string &path)
 
bool CopyDir (FileSource &sourceFS, std::string sourceDir, FileSourceFS &targetFS, std::string targetDir, FileSystem::CopyMode copymode)
 
void Init ()
 
void Uninit ()
 
std::string GetUserDir ()
 
std::string GetDataDir ()
 

Variables

FileSourceUnion gameDataFiles
 
FileSourceFS userFiles (GetUserDir())
 

Enumeration Type Documentation

◆ CopyMode

enum class FileSystem::CopyMode
strong
Enumerator
OVERWRITE 
ONLY_MISSING_IN_TARGET 

Function Documentation

◆ CopyDir()

bool FileSystem::CopyDir ( FileSource sourceFS,
std::string  sourceDir,
FileSourceFS targetFS,
std::string  targetDir,
CopyMode  copymode = CopyMode::OVERWRITE 
)

Copy the contents of a directory from sourceFS into a directory in targetFS, according to copymode. Returns false if sourceDir or targetDir are invalid

Here is the call graph for this function:

◆ GetDataDir()

std::string FileSystem::GetDataDir ( )

◆ GetRelativePath()

std::string FileSystem::GetRelativePath ( const std::string &  base,
const std::string &  path 
)

Given a path in the form <base>/<relpath>, return <relpath>. If <base> is not the exact base of <path>, return <path> unchanged

◆ GetUserDir()

std::string FileSystem::GetUserDir ( )

◆ Init()

void FileSystem::Init ( )
Here is the call graph for this function:

◆ JoinPath()

std::string FileSystem::JoinPath ( const std::string &  a,
const std::string &  b 
)

Create path /, coping with 'a' or 'b' being empty, 'b' being an absolute path, or 'a' not having a trailing separator

◆ JoinPathBelow()

std::string FileSystem::JoinPathBelow ( const std::string &  base,
const std::string &  path 
)

Create path <base>/<path> ensuring that the result points to a path at or below <base> throws an exception (std::invalid_argument) if the path tries to escape <base> must not be empty

◆ NormalisePath()

std::string FileSystem::NormalisePath ( const std::string &  path)

Collapse redundant path separators, and '.' and '..' components NB: this does not interpret symlinks, so the result may refer to an entirely different file than the input throws std::invalid_argument if the input path resolves to a 'negative' path (e.g., "a/../.." resolves to a negative path)

◆ SanitiseFileName()

std::string FileSystem::SanitiseFileName ( const std::string &  a)

Makes a string safe for use as a file name warning: this mapping is non-injective, that is, multiple input names may produce the same output

◆ Uninit()

void FileSystem::Uninit ( )

Variable Documentation

◆ gameDataFiles

FileSourceUnion FileSystem::gameDataFiles

◆ userFiles

FileSourceFS FileSystem::userFiles ( GetUserDir()  )