46 #define reportNonTests(a, b) logger->log(a, b);
48 #define reportNonTests(a, b) reportAlways(a, b)
99 const FsEntry *
const entry = *it;
100 if (entry->
root == root &&
114 const FsEntry *
const entry = *it;
115 if (entry->
root == root &&
134 std::string rootDir = name;
141 if (entry->
funcs->
exists(entry, name, rootDir) ==
true)
158 std::string rootDir =
STD_MOVE(dirName);
183 std::string rootDir =
STD_MOVE(dirName);
205 std::string rootDir =
STD_MOVE(dirName);
228 std::string rootDir =
STD_MOVE(dirName);
248 std::string dirName =
STD_MOVE(name);
255 bool isDirFlag(
false);
349 if (newDir.find(
".zip") != std::string::npos)
354 std::string rootDir = newDir;
361 else if (!subDir.empty() &&
367 if (entry !=
nullptr)
375 logger->
log(
"Add virtual directory: " + newDir);
379 logger->
log(
"Add virtual directory: %s with dir %s",
427 logger->
log(
"VirtFs::mount directory not exists: %s",
442 logger->
log(
"VirtFs::mount directory not exists: %s",
450 bool mountDirSilentTest(std::string newDir,
456 logger->
log(
"VirtFs::mount directory not exists: %s",
462 bool mountDirSilentTest2(std::string newDir,
470 logger->
log(
"VirtFs::mount directory not exists: %s",
486 else if (!subDir.empty() &&
494 if (entry->
root == oldDir &&
502 logger->
log(
"Remove virtual directory: " + oldDir);
506 logger->
log(
"Remove virtual directory: %s with dir %s",
521 if (oldDir.find(
".zip") != std::string::npos)
539 if (oldDir.find(
".zip") != std::string::npos)
557 if (oldDir.find(
".zip") != std::string::npos)
564 logger->
log(
"VirtFs::unmountDir not exists: %s",
575 if (oldDir.find(
".zip") != std::string::npos)
583 logger->
log(
"VirtFs::unmountDir not exists: %s",
600 if (
findLast(newDir,
".zip") ==
false)
621 logger->
log(
"Add virtual zip: " + newDir);
637 if (
findLast(newDir,
".zip") ==
false)
648 else if (!subDir.empty() &&
668 logger->
log(
"Add virtual zip: %s with dir %s",
678 if (
findLast(oldDir,
".zip") ==
false)
686 if (entry->
root == oldDir &&
692 logger->
log(
"Remove virtual zip: " + oldDir);
708 if (
findLast(oldDir,
".zip") ==
false)
718 else if (!subDir.empty() &&
726 if (entry->
root == oldDir &&
732 logger->
log(
"Remove virtual zip: %s with dir %s",
753 return std::string();
772 return std::string();
793 delete static_cast<DirEntry*
>(entry);
795 delete static_cast<ZipEntry*
>(entry);
812 return file->funcs->close(file);
817 const uint32_t objSize,
818 const uint32_t objCount)
820 return file->funcs->read(file,
828 const uint32_t objSize,
829 const uint32_t objCount)
831 return file->funcs->write(file,
839 return file->funcs->fileLength(file);
844 return file->funcs->tell(file);
850 return file->funcs->seek(file,
856 return file->funcs->eof(file);
#define reportAlways(...)
void log(const char *const log_text,...)
#define FOR_EACH(type, iter, array)
const char * dirSeparator
#define reportNonTests(a, b)
FsEntryType ::T FsEntryTypeT
bool existsLocal(const std::string &path)
const char * getBaseDir()
bool isSymbolicLink(std::string name)
bool setWriteDir(std::string newDir)
const char * getUserDir()
void init(const std::string &name)
void permitLinks(const bool val)
bool remove(std::string filename)
bool mkdir(std::string dirname)
bool readArchiveInfo(ZipEntry *entry)
std::vector< FsEntry * > mEntries
File * openRead(std::string filename)
void getDirs(std::string dirName, StringVect &list)
void init(const std::string &name)
bool mkdir(const std::string &dirname)
void updateDirSeparator()
int64_t fileLength(File *const file)
bool mountDir2(std::string newDir, std::string subDir, const Append append)
std::string getRealDir(std::string fileName)
bool remove(const std::string &filename)
bool unmountDirSilent2(std::string oldDir, std::string subDir)
int64_t tell(File *const file)
bool mountDirSilent2(std::string newDir, std::string subDir, const Append append)
const char * getBaseDir()
void freeList(List *const handle)
bool isSymbolicLink(const std::string &name)
int64_t write(File *const file, const void *const buffer, const uint32_t objSize, const uint32_t objCount)
bool mountDirInternal(const std::string &newDir, std::string subDir, const Append append)
bool unmountDirSilent(std::string oldDir)
int close(File *const file)
bool mountZip(std::string newDir, const Append append)
int seek(File *const file, const uint64_t pos)
FsEntry * searchByTypeInternal(const std::string &root, const FsEntryTypeT type)
bool unmountZip(std::string oldDir)
int64_t read(File *const file, void *const buffer, const uint32_t objSize, const uint32_t objCount)
bool unmountDir2(std::string oldDir, std::string subDir)
std::vector< FsEntry * > & getEntries()
bool isDirectory(std::string name)
void getFilesWithDir(std::string dirName, StringVect &list)
const char * loadFile(std::string filename, int &fileSize)
void addEntry(FsEntry *const entry, const Append append)
void permitLinks(const bool val)
FsEntry * searchByRootInternal(const std::string &root, const std::string &subDir)
List * enumerateFiles(std::string dirName)
bool setWriteDir(const std::string &newDir)
const char * getUserDir()
bool mountDir(std::string newDir, const Append append)
bool mountDirSilent(std::string newDir, const Append append)
const char * getDirSeparator()
bool unmountZip2(std::string oldDir, std::string subDir)
void getFiles(std::string dirName, StringVect &list)
File * openWrite(std::string filename)
bool unmountDir(std::string oldDir)
bool unmountDirInternal(std::string oldDir, std::string subDir)
File * openAppend(std::string filename)
bool mountZip2(std::string newDir, std::string subDir, const Append append)
int eof(File *const file)
bool exists(std::string name)
bool checkPath(const std::string &path)
void prepareFsPath(std::string &path)
bool findLast(const std::string &str1, const std::string &str2)
std::vector< std::string > StringVect
void(* getDirs)(FsEntry *const entry, std::string dirName, StringVect &names)
File *(* openWrite)(FsEntry *const entry, const std::string &filename)
bool(* exists)(FsEntry *const entry, std::string filename, std::string dirName)
void(* enumerate)(FsEntry *const entry, std::string dirName, StringVect &names)
File *(* openAppend)(FsEntry *const entry, const std::string &filename)
File *(* openRead)(FsEntry *const entry, std::string filename)
const char *(* loadFile)(FsEntry *const entry, std::string fileName, int &fileSize)
void(* getFilesWithDir)(FsEntry *const entry, const std::string &dirName, StringVect &names)
bool(* getRealDir)(FsEntry *const entry, std::string filename, std::string dirName, std::string &realDir)
void(* getFiles)(FsEntry *const entry, std::string dirName, StringVect &names)
bool(* isDirectory)(FsEntry *const entry, std::string dirName, bool &isDirFlag)