ManaPlus
|
Namespaces | |
anonymous_namespace{fs.cpp} | |
anonymous_namespace{fsdir.cpp} | |
FsDir | |
FsZip | |
ZipReader | |
Data Structures | |
struct | DirEntry |
struct | File |
struct | FsEntry |
struct | FsFuncs |
struct | List |
struct | ZipEntry |
struct | ZipLocalHeader |
Functions | |
void | init (const std::string &name) |
void | updateDirSeparator () |
const char * | getDirSeparator () |
const char * | getBaseDir () |
const char * | getUserDir () |
std::vector< FsEntry * > & | getEntries () |
FsEntry * | searchByRootInternal (const std::string &root, const std::string &subDir) |
FsEntry * | searchByTypeInternal (const std::string &root, const FsEntryTypeT type) |
bool | exists (std::string name) |
List * | enumerateFiles (std::string dirName) |
void | getFiles (std::string dirName, StringVect &list) |
void | getFilesWithDir (std::string dirName, StringVect &list) |
void | getDirs (std::string dirName, StringVect &list) |
bool | isDirectory (std::string name) |
bool | isSymbolicLink (const std::string &name) |
void | freeList (List *const handle) |
File * | openRead (std::string filename) |
File * | openWrite (std::string filename) |
File * | openAppend (std::string filename) |
bool | setWriteDir (const std::string &newDir) |
void | addEntry (FsEntry *const entry, const Append append) |
bool | mountDirInternal (const std::string &newDir, std::string subDir, const Append append) |
bool | mountDir (std::string newDir, const Append append) |
bool | mountDir2 (std::string newDir, std::string subDir, const Append append) |
bool | mountDirSilent (std::string newDir, const Append append) |
bool | mountDirSilent2 (std::string newDir, std::string subDir, const Append append) |
bool | unmountDirInternal (std::string oldDir, std::string subDir) |
bool | unmountDir (std::string oldDir) |
bool | unmountDir2 (std::string oldDir, std::string subDir) |
bool | unmountDirSilent (std::string oldDir) |
bool | unmountDirSilent2 (std::string oldDir, std::string subDir) |
bool | mountZip (std::string newDir, const Append append) |
bool | mountZip2 (std::string newDir, std::string subDir, const Append append) |
bool | unmountZip (std::string oldDir) |
bool | unmountZip2 (std::string oldDir, std::string subDir) |
std::string | getRealDir (std::string fileName) |
bool | mkdir (const std::string &dirname) |
bool | remove (const std::string &filename) |
bool | deinit () |
void | permitLinks (const bool val) |
int | close (File *const file) |
int64_t | read (File *const file, void *const buffer, const uint32_t objSize, const uint32_t objCount) |
int64_t | write (File *const file, const void *const buffer, const uint32_t objSize, const uint32_t objCount) |
int64_t | fileLength (File *const file) |
int64_t | tell (File *const file) |
int | seek (File *const file, const uint64_t pos) |
int | eof (File *const file) |
const char * | loadFile (std::string filename, int &fileSize) |
SDL_RWops * | create_rwops (File *const file, const std::string &fname) |
SDL_RWops * | rwopsOpenRead (const std::string &fname) |
SDL_RWops * | rwopsOpenWrite (const std::string &fname) |
SDL_RWops * | rwopsOpenAppend (const std::string &fname) |
void | searchAndAddArchives (const std::string &path, const std::string &ext, const Append append) |
void | searchAndRemoveArchives (const std::string &path, const std::string &ext) |
void | getFilesInDir (const std::string &dir, StringVect &list, const std::string &ext) |
std::string | getPath (const std::string &file) |
std::string | loadTextFileString (const std::string &fileName) |
bool | loadTextFile (const std::string &fileName, StringVect &lines) |
Definition at line 336 of file fs.cpp.
References Append_true, and VirtFs::anonymous_namespace{fs.cpp}::mEntries.
Referenced by mountDirInternal(), mountZip(), and mountZip2().
int VirtFs::close | ( | File *const | file | ) |
SDL_RWops * VirtFs::create_rwops | ( | File *const | file, |
const std::string & | fname | ||
) |
Definition at line 66 of file rwops.cpp.
References VirtFs::File::funcs, reportAlways, VirtFs::FsFuncs::rwops_close, VirtFs::FsFuncs::rwops_read, VirtFs::FsFuncs::rwops_seek, VirtFs::FsFuncs::rwops_write, and VirtFs::FsFuncs::seek.
Referenced by rwopsOpenAppend(), rwopsOpenRead(), and rwopsOpenWrite().
bool VirtFs::deinit | ( | ) |
Definition at line 785 of file fs.cpp.
References VirtFs::FsDir::deinit(), VirtFs::FsZip::deinit(), FsEntryType::Dir, FOR_EACH, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsEntry::type, and FsEntryType::Zip.
Referenced by Client::gameClear(), main(), mainGui(), and Client::runValidate().
List * VirtFs::enumerateFiles | ( | std::string | dirName | ) |
Definition at line 147 of file fs.cpp.
References checkPath(), dirSeparator, VirtFs::FsFuncs::enumerate, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::List::names, prepareFsPath(), reportAlways, and STD_MOVE.
Referenced by Theme::fillSoundsList(), Wallpaper::loadWallpapers(), searchAndAddArchives(), and searchAndRemoveArchives().
int VirtFs::eof | ( | File *const | file | ) |
bool VirtFs::exists | ( | std::string | name | ) |
Definition at line 124 of file fs.cpp.
References checkPath(), dirSeparator, VirtFs::FsFuncs::exists, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), and reportAlways.
Referenced by Game::changeMap(), PoParser::checkLang(), ItemDB::getNamesStr(), Configuration::init(), loadMusic(), Theme::readSkin(), Theme::resolveThemePath(), Minimap::setMap(), Theme::tryThemePath(), and MapReader::updateMusic().
int64_t VirtFs::fileLength | ( | File *const | file | ) |
void VirtFs::freeList | ( | List *const | handle | ) |
Definition at line 269 of file fs.cpp.
Referenced by Theme::fillSoundsList(), Wallpaper::loadWallpapers(), searchAndAddArchives(), and searchAndRemoveArchives().
const char * VirtFs::getBaseDir | ( | ) |
Definition at line 79 of file fs.cpp.
References VirtFs::FsDir::getBaseDir().
Referenced by getHomePath(), GettextHelper::initLang(), Dirs::initRootDir(), and mainGui().
void VirtFs::getDirs | ( | std::string | dirName, |
StringVect & | list | ||
) |
Definition at line 217 of file fs.cpp.
References checkPath(), dirSeparator, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::getDirs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, and STD_MOVE.
Referenced by Theme::fillSkinsList().
const char * VirtFs::getDirSeparator | ( | ) |
std::vector< FsEntry * > & VirtFs::getEntries | ( | ) |
Definition at line 89 of file fs.cpp.
References VirtFs::anonymous_namespace{fs.cpp}::mEntries.
void VirtFs::getFiles | ( | std::string | dirName, |
StringVect & | list | ||
) |
Definition at line 172 of file fs.cpp.
References checkPath(), dirSeparator, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::getFiles, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, and STD_MOVE.
Referenced by Theme::fillFontsList().
void VirtFs::getFilesInDir | ( | const std::string & | dir, |
StringVect & | list, | ||
const std::string & | ext | ||
) |
Definition at line 81 of file tools.cpp.
References findLast(), FOR_EACH, and getFilesWithDir().
Referenced by ColorDB::load(), ItemDB::load(), loadDB(), and HelpWindow::loadTags().
void VirtFs::getFilesWithDir | ( | std::string | dirName, |
StringVect & | list | ||
) |
Definition at line 194 of file fs.cpp.
References checkPath(), dirSeparator, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::getFilesWithDir, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, and STD_MOVE.
Referenced by getFilesInDir().
std::string VirtFs::getPath | ( | const std::string & | file | ) |
Definition at line 97 of file tools.cpp.
References getPackageDir(), getRealDir(), and pathJoin().
Referenced by Font::openFont(), and WindowManager::setIcon().
std::string VirtFs::getRealDir | ( | std::string | fileName | ) |
Definition at line 746 of file fs.cpp.
References checkPath(), dirSeparator, fileName, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::getRealDir, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), and reportAlways.
Referenced by getPath(), searchAndAddArchives(), and searchAndRemoveArchives().
const char * VirtFs::getUserDir | ( | ) |
Definition at line 84 of file fs.cpp.
References VirtFs::FsDir::getUserDir().
Referenced by getPicturesDir(), Dirs::initConfigDir(), Dirs::initLocalDataDir(), and Game::saveScreenshot().
void VirtFs::init | ( | const std::string & | name | ) |
Definition at line 58 of file fs.cpp.
References VirtFs::FsZip::init(), VirtFs::FsDir::init(), and updateDirSeparator().
bool VirtFs::isDirectory | ( | std::string | name | ) |
Definition at line 239 of file fs.cpp.
References checkPath(), dirSeparator, findLast(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::isDirectory, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, and STD_MOVE.
Referenced by Theme::fillSoundsList(), initDefaultThemePath(), initDefaultWallpaperPaths(), and Dirs::initUpdatesDir().
bool VirtFs::isSymbolicLink | ( | const std::string & | name | ) |
const char * VirtFs::loadFile | ( | std::string | filename, |
int & | fileSize | ||
) |
Definition at line 859 of file fs.cpp.
References checkPath(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::FsFuncs::loadFile, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), and reportAlways.
Referenced by XML::Document::Document(), UpdaterWindow::getFileHash(), loadTextFile(), loadTextFileString(), PoParser::openFile(), and TranslationManager::translateFile().
bool VirtFs::loadTextFile | ( | const std::string & | fileName, |
StringVect & | lines | ||
) |
Definition at line 137 of file tools.cpp.
References fileName, loadFile(), Logger::log(), and logger.
Referenced by ChatWindow::loadCommandsFile(), PaletteDB::loadPalette(), and HelpWindow::loadTags().
std::string VirtFs::loadTextFileString | ( | const std::string & | fileName | ) |
Definition at line 122 of file tools.cpp.
References fileName, loadFile(), Logger::log(), and logger.
Referenced by ShadersManager::createShader().
bool VirtFs::mkdir | ( | const std::string & | dirname | ) |
Definition at line 775 of file fs.cpp.
References VirtFs::FsDir::mkdir().
Referenced by Dirs::initUpdatesDir(), and mkdir_r().
bool VirtFs::mountDir | ( | std::string | newDir, |
const Append | append | ||
) |
Definition at line 393 of file fs.cpp.
References dirSeparator, Files::existsLocal(), mountDirInternal(), prepareFsPath(), and reportNonTests.
Referenced by Client::gameExec(), Client::gameInit(), Client::loadData(), UpdaterWindow::loadDirMods(), main(), and Dirs::mountDataDir().
bool VirtFs::mountDir2 | ( | std::string | newDir, |
std::string | subDir, | ||
const Append | append | ||
) |
Definition at line 406 of file fs.cpp.
References Files::existsLocal(), mountDirInternal(), prepareFsPath(), and reportNonTests.
bool VirtFs::mountDirInternal | ( | const std::string & | newDir, |
std::string | subDir, | ||
const Append | append | ||
) |
Definition at line 345 of file fs.cpp.
References addEntry(), dirSeparator, findLast(), VirtFs::FsDir::getFuncs(), Logger::log(), logger, reportAlways, and searchByRootInternal().
Referenced by mountDir(), mountDir2(), mountDirSilent(), and mountDirSilent2().
bool VirtFs::mountDirSilent | ( | std::string | newDir, |
const Append | append | ||
) |
Definition at line 421 of file fs.cpp.
References Files::existsLocal(), Logger::log(), logger, mountDirInternal(), and prepareFsPath().
Referenced by Dirs::mountDataDir().
bool VirtFs::mountDirSilent2 | ( | std::string | newDir, |
std::string | subDir, | ||
const Append | append | ||
) |
Definition at line 434 of file fs.cpp.
References Files::existsLocal(), Logger::log(), logger, mountDirInternal(), and prepareFsPath().
bool VirtFs::mountZip | ( | std::string | newDir, |
const Append | append | ||
) |
Definition at line 590 of file fs.cpp.
References addEntry(), Files::existsLocal(), findLast(), VirtFs::FsZip::getFuncs(), Logger::log(), logger, prepareFsPath(), VirtFs::ZipReader::readArchiveInfo(), reportAlways, reportNonTests, and searchByRootInternal().
Referenced by UpdaterWindow::addUpdateFile(), UpdaterWindow::loadManaPlusUpdates(), UpdaterWindow::loadMods(), Dirs::mountDataDir(), and searchAndAddArchives().
bool VirtFs::mountZip2 | ( | std::string | newDir, |
std::string | subDir, | ||
const Append | append | ||
) |
Definition at line 626 of file fs.cpp.
References addEntry(), dirSeparator, Files::existsLocal(), findLast(), VirtFs::FsZip::getFuncs(), Logger::log(), logger, prepareFsPath(), VirtFs::ZipReader::readArchiveInfo(), reportAlways, reportNonTests, and searchByRootInternal().
Referenced by Dirs::extractDataDir(), and Dirs::mountDataDir().
File * VirtFs::openAppend | ( | std::string | filename | ) |
Definition at line 312 of file fs.cpp.
References checkPath(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsFuncs::openAppend, prepareFsPath(), and reportAlways.
Referenced by rwopsOpenAppend().
File * VirtFs::openRead | ( | std::string | filename | ) |
Definition at line 274 of file fs.cpp.
References checkPath(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsFuncs::openRead, prepareFsPath(), and reportAlways.
Referenced by rwopsOpenRead().
File * VirtFs::openWrite | ( | std::string | filename | ) |
Definition at line 293 of file fs.cpp.
References checkPath(), FOR_EACH, VirtFs::FsEntry::funcs, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsFuncs::openWrite, prepareFsPath(), and reportAlways.
Referenced by rwopsOpenWrite().
void VirtFs::permitLinks | ( | const bool | val | ) |
Definition at line 803 of file fs.cpp.
References VirtFs::FsDir::permitLinks().
Referenced by Theme::fillFontsList().
int64_t VirtFs::read | ( | File *const | file, |
void *const | buffer, | ||
const uint32_t | objSize, | ||
const uint32_t | objCount | ||
) |
Definition at line 815 of file fs.cpp.
Referenced by Net::Download::fadler32().
bool VirtFs::remove | ( | const std::string & | filename | ) |
Definition at line 780 of file fs.cpp.
References VirtFs::FsDir::remove().
Referenced by ConfigManager::backupConfig(), Files::deleteFilesInDirectory(), Net::Download::downloadThread(), Configuration::removeListeners(), and Files::renameFile().
SDL_RWops * VirtFs::rwopsOpenAppend | ( | const std::string & | fname | ) |
Definition at line 143 of file rwops.cpp.
References create_rwops(), and openAppend().
SDL_RWops * VirtFs::rwopsOpenRead | ( | const std::string & | fname | ) |
Definition at line 107 of file rwops.cpp.
References BLOCK_END, BLOCK_START, create_rwops(), and openRead().
Referenced by anonymous_namespace{imageloader.cpp}::DyedImageLoader::load(), anonymous_namespace{musicloader.cpp}::ResourceLoader::load(), anonymous_namespace{soundloader.cpp}::ResourceLoader::load(), AtlasManager::loadImages(), and Font::openFont().
SDL_RWops * VirtFs::rwopsOpenWrite | ( | const std::string & | fname | ) |
void VirtFs::searchAndAddArchives | ( | const std::string & | path, |
const std::string & | ext, | ||
const Append | append | ||
) |
Definition at line 41 of file tools.cpp.
References enumerateFiles(), FOR_EACH, freeList(), getRealDir(), mountZip(), VirtFs::List::names, and pathJoin().
Referenced by Client::gameExec(), and Client::loadData().
void VirtFs::searchAndRemoveArchives | ( | const std::string & | path, |
const std::string & | ext | ||
) |
Definition at line 62 of file tools.cpp.
References enumerateFiles(), FOR_EACH, freeList(), getRealDir(), VirtFs::List::names, pathJoin(), and unmountZip().
Referenced by Client::unloadData().
FsEntry * VirtFs::searchByRootInternal | ( | const std::string & | root, |
const std::string & | subDir | ||
) |
Definition at line 94 of file fs.cpp.
References FOR_EACH, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsEntry::root, and VirtFs::FsEntry::subDir.
Referenced by mountDirInternal(), mountZip(), and mountZip2().
FsEntry * VirtFs::searchByTypeInternal | ( | const std::string & | root, |
const FsEntryTypeT | type | ||
) |
Definition at line 109 of file fs.cpp.
References FOR_EACH, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsEntry::root, and VirtFs::FsEntry::type.
int VirtFs::seek | ( | File *const | file, |
const uint64_t | pos | ||
) |
Definition at line 847 of file fs.cpp.
Referenced by TextManager::place().
bool VirtFs::setWriteDir | ( | const std::string & | newDir | ) |
Definition at line 331 of file fs.cpp.
References VirtFs::FsDir::setWriteDir().
Referenced by Client::gameInit(), and main().
int64_t VirtFs::tell | ( | File *const | file | ) |
bool VirtFs::unmountDir | ( | std::string | oldDir | ) |
Definition at line 518 of file fs.cpp.
References prepareFsPath(), reportAlways, and unmountDirInternal().
Referenced by UpdaterWindow::unloadMods().
bool VirtFs::unmountDir2 | ( | std::string | oldDir, |
std::string | subDir | ||
) |
Definition at line 535 of file fs.cpp.
References prepareFsPath(), reportAlways, and unmountDirInternal().
bool VirtFs::unmountDirInternal | ( | std::string | oldDir, |
std::string | subDir | ||
) |
Definition at line 477 of file fs.cpp.
References FsEntryType::Dir, dirSeparator, findLast(), FOR_EACH, Logger::log(), logger, VirtFs::anonymous_namespace{fs.cpp}::mEntries, VirtFs::FsEntry::root, VirtFs::FsEntry::subDir, and VirtFs::FsEntry::type.
Referenced by unmountDir(), unmountDir2(), unmountDirSilent(), and unmountDirSilent2().
bool VirtFs::unmountDirSilent | ( | std::string | oldDir | ) |
Definition at line 554 of file fs.cpp.
References Logger::log(), logger, prepareFsPath(), reportAlways, and unmountDirInternal().
Referenced by Client::unloadData().
bool VirtFs::unmountDirSilent2 | ( | std::string | oldDir, |
std::string | subDir | ||
) |
Definition at line 571 of file fs.cpp.
References Logger::log(), logger, prepareFsPath(), reportAlways, and unmountDirInternal().
bool VirtFs::unmountZip | ( | std::string | oldDir | ) |
Definition at line 675 of file fs.cpp.
References findLast(), FOR_EACH, Logger::log(), logger, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, VirtFs::FsEntry::root, VirtFs::FsEntry::subDir, VirtFs::FsEntry::type, and FsEntryType::Zip.
Referenced by UpdaterWindow::removeUpdateFile(), searchAndRemoveArchives(), and UpdaterWindow::unloadManaPlusUpdates().
bool VirtFs::unmountZip2 | ( | std::string | oldDir, |
std::string | subDir | ||
) |
Definition at line 704 of file fs.cpp.
References dirSeparator, findLast(), FOR_EACH, Logger::log(), logger, VirtFs::anonymous_namespace{fs.cpp}::mEntries, prepareFsPath(), reportAlways, VirtFs::FsEntry::root, VirtFs::FsEntry::subDir, VirtFs::FsEntry::type, and FsEntryType::Zip.
void VirtFs::updateDirSeparator | ( | ) |
int64_t VirtFs::write | ( | File *const | file, |
const void *const | buffer, | ||
const uint32_t | objSize, | ||
const uint32_t | objCount | ||
) |
Definition at line 826 of file fs.cpp.
Referenced by Net::Download::setWriteFunction().