]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/android/dir_location.cpp
Have get_user_data_dir return a proper location on Android
[libs/core.git] / source / fs / android / dir_location.cpp
diff --git a/source/fs/android/dir_location.cpp b/source/fs/android/dir_location.cpp
new file mode 100644 (file)
index 0000000..f9e0ea5
--- /dev/null
@@ -0,0 +1,22 @@
+#include <msp/core/application.h>
+#include <msp/core/mainthread.h>
+#include "dir.h"
+
+using namespace std;
+
+namespace Msp {
+namespace FS {
+
+Path get_home_dir()
+{
+       return "/sdcard";
+}
+
+Path get_user_data_dir(const string &)
+{
+       Android::MainThread *thread = reinterpret_cast<Android::MainThread *>(Application::get_data());
+       return thread->get_internal_data_path();
+}
+
+} // namespace FS
+} // namespace Msp