Otclient  14/8/2020
ResourceManager Class Reference

#include <resourcemanager.h>

Public Member Functions

void init (const char *argv0)
 
void terminate ()
 
bool discoverWorkDir (const std::string &existentFile)
 
bool setupUserWriteDir (const std::string &appWriteDirName)
 
bool setWriteDir (const std::string &writeDir, bool create=false)
 
bool addSearchPath (const std::string &path, bool pushFront=false)
 
bool removeSearchPath (const std::string &path)
 
void searchAndAddPackages (const std::string &packagesDir, const std::string &packageExt)
 
bool fileExists (const std::string &fileName)
 
bool directoryExists (const std::string &directoryName)
 
void readFileStream (const std::string &fileName, std::iostream &out)
 
std::string readFileContents (const std::string &fileName)
 
bool writeFileBuffer (const std::string &fileName, const uchar *data, uint size)
 
bool writeFileContents (const std::string &fileName, const std::string &data)
 
bool writeFileStream (const std::string &fileName, std::iostream &in)
 
FileStreamPtr openFile (const std::string &fileName)
 
FileStreamPtr appendFile (const std::string &fileName)
 
FileStreamPtr createFile (const std::string &fileName)
 
bool deleteFile (const std::string &fileName)
 
bool makeDir (const std::string directory)
 
std::list< std::string > listDirectoryFiles (const std::string &directoryPath="")
 
std::vector< std::string > getDirectoryFiles (const std::string &path, bool filenameOnly, bool recursive)
 
std::string resolvePath (const std::string &path)
 
std::string getRealDir (const std::string &path)
 
std::string getRealPath (const std::string &path)
 
std::string getBaseDir ()
 
std::string getUserDir ()
 
std::string getWriteDir ()
 
std::string getWorkDir ()
 
std::deque< std::string > getSearchPaths ()
 
std::string guessFilePath (const std::string &filename, const std::string &type)
 
bool isFileType (const std::string &filename, const std::string &type)
 
ticks_t getFileTime (const std::string &filename)
 

Protected Member Functions

std::vector< std::string > discoverPath (const fs::path &path, bool filenameOnly, bool recursive)
 

Detailed Description

Definition at line 33 of file resourcemanager.h.

Member Function Documentation

◆ addSearchPath()

bool ResourceManager::addSearchPath ( const std::string &  path,
bool  pushFront = false 
)

Definition at line 108 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ appendFile()

FileStreamPtr ResourceManager::appendFile ( const std::string &  fileName)

Definition at line 242 of file resourcemanager.cpp.

Here is the call graph for this function:

◆ createFile()

FileStreamPtr ResourceManager::createFile ( const std::string &  fileName)

Definition at line 250 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteFile()

bool ResourceManager::deleteFile ( const std::string &  fileName)

Definition at line 258 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ directoryExists()

bool ResourceManager::directoryExists ( const std::string &  directoryName)

Definition at line 163 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ discoverPath()

std::vector< std::string > ResourceManager::discoverPath ( const fs::path &  path,
bool  filenameOnly,
bool  recursive 
)
protected

Definition at line 289 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ discoverWorkDir()

bool ResourceManager::discoverWorkDir ( const std::string &  existentFile)

Definition at line 45 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileExists()

bool ResourceManager::fileExists ( const std::string &  fileName)

Definition at line 157 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBaseDir()

std::string ResourceManager::getBaseDir ( )

Definition at line 342 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ getDirectoryFiles()

std::vector< std::string > ResourceManager::getDirectoryFiles ( const std::string &  path,
bool  filenameOnly,
bool  recursive 
)

Definition at line 280 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileTime()

ticks_t ResourceManager::getFileTime ( const std::string &  filename)

Definition at line 366 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealDir()

std::string ResourceManager::getRealDir ( const std::string &  path)

Definition at line 328 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealPath()

std::string ResourceManager::getRealPath ( const std::string &  path)

Definition at line 337 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSearchPaths()

std::deque<std::string> ResourceManager::getSearchPaths ( )
inline

Definition at line 77 of file resourcemanager.h.

Here is the caller graph for this function:

◆ getUserDir()

std::string ResourceManager::getUserDir ( )

Definition at line 347 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ getWorkDir()

std::string ResourceManager::getWorkDir ( )
inline

Definition at line 76 of file resourcemanager.h.

Here is the caller graph for this function:

◆ getWriteDir()

std::string ResourceManager::getWriteDir ( )
inline

Definition at line 75 of file resourcemanager.h.

Here is the caller graph for this function:

◆ guessFilePath()

std::string ResourceManager::guessFilePath ( const std::string &  filename,
const std::string &  type 
)

Definition at line 352 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void ResourceManager::init ( const char *  argv0)

Definition at line 34 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ isFileType()

bool ResourceManager::isFileType ( const std::string &  filename,
const std::string &  type 
)

Definition at line 359 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listDirectoryFiles()

std::list< std::string > ResourceManager::listDirectoryFiles ( const std::string &  directoryPath = "")

Definition at line 268 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeDir()

bool ResourceManager::makeDir ( const std::string  directory)

Definition at line 263 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ openFile()

FileStreamPtr ResourceManager::openFile ( const std::string &  fileName)

Definition at line 232 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFileContents()

std::string ResourceManager::readFileContents ( const std::string &  fileName)

Definition at line 185 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFileStream()

void ResourceManager::readFileStream ( const std::string &  fileName,
std::iostream &  out 
)

Definition at line 173 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSearchPath()

bool ResourceManager::removeSearchPath ( const std::string &  path)

Definition at line 134 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ resolvePath()

std::string ResourceManager::resolvePath ( const std::string &  path)

Definition at line 311 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchAndAddPackages()

void ResourceManager::searchAndAddPackages ( const std::string &  packagesDir,
const std::string &  packageExt 
)

Definition at line 144 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupUserWriteDir()

bool ResourceManager::setupUserWriteDir ( const std::string &  appWriteDirName)

Definition at line 70 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWriteDir()

bool ResourceManager::setWriteDir ( const std::string &  writeDir,
bool  create = false 
)

Definition at line 90 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate()

void ResourceManager::terminate ( )

Definition at line 40 of file resourcemanager.cpp.

Here is the caller graph for this function:

◆ writeFileBuffer()

bool ResourceManager::writeFileBuffer ( const std::string &  fileName,
const uchar data,
uint  size 
)

Definition at line 201 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeFileContents()

bool ResourceManager::writeFileContents ( const std::string &  fileName,
const std::string &  data 
)

Definition at line 227 of file resourcemanager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeFileStream()

bool ResourceManager::writeFileStream ( const std::string &  fileName,
std::iostream &  in 
)

Definition at line 214 of file resourcemanager.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: