diff options
Diffstat (limited to 'src/fs/virtfs/virtfsdir.h')
-rw-r--r-- | src/fs/virtfs/virtfsdir.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/fs/virtfs/virtfsdir.h b/src/fs/virtfs/virtfsdir.h index 6ae3ec9f1..069c20c8d 100644 --- a/src/fs/virtfs/virtfsdir.h +++ b/src/fs/virtfs/virtfsdir.h @@ -25,13 +25,13 @@ #include "enums/simpletypes/append.h" #include "enums/simpletypes/skiperror.h" -#include "localconsts.h" +#include "utils/stringvector.h" -#include <vector> -#include <string> +#include "localconsts.h" struct VirtDirEntry; struct VirtFile; +struct VirtFsEntry; struct VirtFsFuncs; struct VirtList; @@ -39,10 +39,17 @@ namespace VirtFsDir { VirtDirEntry *searchEntryByRoot(const std::string &restrict root); VirtDirEntry *searchEntryByPath(const std::string &restrict path); + VirtFile *openRead(VirtFsEntry *restrict const entry, + const std::string &filename); + VirtFile *openWrite(VirtFsEntry *restrict const entry, + const std::string &filename); + VirtFile *openAppend(VirtFsEntry *restrict const entry, + const std::string &filename); VirtFile *openReadDirEntry(VirtDirEntry *const entry, const std::string &filename); const char *getBaseDir(); const char *getUserDir(); + VirtFsFuncs *getFuncs(); bool addToSearchPath(std::string newDir, const Append append); bool addToSearchPathSilent(std::string newDir, @@ -55,10 +62,18 @@ namespace VirtFsDir void deinit(); std::vector<VirtDirEntry*> &getEntries(); bool exists(std::string name); + bool exists(VirtFsEntry *restrict const entry, + const std::string &fileName, + const std::string &dirName); + void enumerate(VirtFsEntry *restrict const entry, + const std::string &dirName, + StringVect &names); VirtList *enumerateFiles(std::string dirName) RETURNS_NONNULL; VirtList *enumerateFiles(const std::string &restrict dirName, VirtList *restrict const list) RETURNS_NONNULL; - bool isDirectory(std::string dirName); + bool isDirectory(VirtFsEntry *restrict const entry, + const std::string &dirName, + bool &isDirFlag); bool isDirectoryInternal(const std::string &restrict dirName); bool isSymbolicLink(std::string name); void freeList(VirtList *restrict const handle); @@ -67,6 +82,10 @@ namespace VirtFsDir VirtFile *openAppend(const std::string &restrict filename); bool setWriteDir(std::string newDir); std::string getRealDir(std::string filename); + bool getRealDir(VirtFsEntry *restrict const entry, + const std::string &filename, + const std::string &dirName, + std::string &realDir); bool mkdir(std::string dirName); bool remove(std::string filename); void permitLinks(const bool val); |