Route prepared file targets through platform services
This commit is contained in:
@@ -10,6 +10,12 @@ namespace pp::platform {
|
||||
using PickedPathCallback = std::function<void(std::string path)>;
|
||||
using PreparedFileCallback = std::function<void(std::string path, bool saved)>;
|
||||
|
||||
struct PreparedFileTarget {
|
||||
std::string path;
|
||||
std::string suggested_name;
|
||||
bool write_on_background_thread = false;
|
||||
};
|
||||
|
||||
struct PlatformStoragePaths {
|
||||
std::string data_path;
|
||||
std::string work_path;
|
||||
@@ -57,6 +63,11 @@ public:
|
||||
virtual void pick_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
||||
virtual void pick_save_file(std::vector<std::string> file_types, PickedPathCallback callback) = 0;
|
||||
virtual void pick_directory(PickedPathCallback callback) = 0;
|
||||
[[nodiscard]] virtual PreparedFileTarget prepare_writable_file(
|
||||
std::string_view type,
|
||||
std::string_view default_name,
|
||||
std::string_view data_path,
|
||||
std::string_view temporary_path) = 0;
|
||||
virtual void save_prepared_file(
|
||||
std::string_view path,
|
||||
std::string_view suggested_name,
|
||||
|
||||
Reference in New Issue
Block a user