android save picker, create dir api wip
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#ifdef __ANDROID__
|
||||
void displayKeyboard(bool pShow);
|
||||
void android_pick_file(std::function<void(std::string)> callback);
|
||||
void android_pick_file_save(std::function<void(std::string)> callback);
|
||||
std::string android_get_clipboard();
|
||||
bool android_set_clipboard(const std::string& s);
|
||||
#elif _WIN32
|
||||
@@ -228,7 +229,7 @@ void App::pick_file_save(std::vector<std::string> types, std::function<void (std
|
||||
callback(path);
|
||||
});
|
||||
#elif __ANDROID__
|
||||
//android_pick_file(callback);
|
||||
android_pick_file_save(callback);
|
||||
#elif _WIN32
|
||||
std::string filter = "Supported Files (";
|
||||
bool first_type = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifdef __ANDROID__
|
||||
#include <dirent.h>
|
||||
AAssetManager* Asset::m_am;
|
||||
bool android_create_dir(const std::string& path);
|
||||
#endif
|
||||
|
||||
bool Asset::delete_file(const std::string& path)
|
||||
@@ -134,6 +135,15 @@ bool Asset::is_asset(const std::string & path)
|
||||
return path.substr(0, 5) == "data/";
|
||||
}
|
||||
|
||||
bool Asset::create_dir(const std::string& path)
|
||||
{
|
||||
#if __WIN__
|
||||
return PathFileExistsA(path.c_str()) ? true : CreateDirectoryA(path.c_str(), NULL);
|
||||
#elif __ANDROID__
|
||||
return android_create_dir(path);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Asset::open(const char* path)
|
||||
{
|
||||
//LOG("Asset::open %s", path);
|
||||
|
||||
@@ -12,6 +12,7 @@ public:
|
||||
static bool delete_file(const std::string& path);
|
||||
static std::string absolute(const std::string& path);
|
||||
static bool is_asset(const std::string& path);
|
||||
static bool create_dir(const std::string& path);
|
||||
std::string m_current_path;
|
||||
FILE* m_fp = nullptr;
|
||||
int m_len = 0;
|
||||
|
||||
Reference in New Issue
Block a user