diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-27 20:06:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-27 20:06:01 +0300 |
commit | 0018db94c954ee8eb3764c688a7ff7d3324ddee0 (patch) | |
tree | 0bc60f668d48c83af9fe400c40f2134a4ed04eec /src | |
parent | bf41330551a76ea426ace38dbc57c333ef5112cc (diff) | |
download | plus-0018db94c954ee8eb3764c688a7ff7d3324ddee0.tar.gz plus-0018db94c954ee8eb3764c688a7ff7d3324ddee0.tar.bz2 plus-0018db94c954ee8eb3764c688a7ff7d3324ddee0.tar.xz plus-0018db94c954ee8eb3764c688a7ff7d3324ddee0.zip |
Add own user dir in VirtFsDir.
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/virtfsdir.cpp | 7 | ||||
-rw-r--r-- | src/fs/virtfsdir.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/fs/virtfsdir.cpp b/src/fs/virtfsdir.cpp index d27355d40..605ad2aac 100644 --- a/src/fs/virtfsdir.cpp +++ b/src/fs/virtfsdir.cpp @@ -51,6 +51,7 @@ namespace std::vector<VirtDirEntry*> mEntries; std::string mWriteDir; std::string mBaseDir; + std::string mUserDir; bool mPermitLinks = false; VirtFsFuncs funcs; } // namespace @@ -268,6 +269,7 @@ namespace VirtFsDir mBaseDir = getRealPath(getFileDir(name)); #endif // defined(__native_client__) + mUserDir = getHomePath(); initFuncs(&funcs); } @@ -287,6 +289,11 @@ namespace VirtFsDir return mBaseDir.c_str(); } + const char *getUserDir() + { + return mUserDir.c_str(); + } + std::string getRealDir(const std::string &restrict filename) { if (checkPath(filename) == false) diff --git a/src/fs/virtfsdir.h b/src/fs/virtfsdir.h index f528dad30..0f36b1241 100644 --- a/src/fs/virtfsdir.h +++ b/src/fs/virtfsdir.h @@ -39,6 +39,7 @@ namespace VirtFsDir VirtDirEntry *searchEntryByRoot(const std::string &restrict root); VirtDirEntry *searchEntryByPath(const std::string &restrict path); const char *getBaseDir(); + const char *getUserDir(); bool addToSearchPath(const std::string &newDir, const Append append); bool addToSearchPathSilent(const std::string &newDir, |