summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/virtfsdir.cpp7
-rw-r--r--src/fs/virtfsdir.h1
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,