Checkpoint 4: harden native paths, authoring workflows and Player lifecycle

This commit is contained in:
Emil
2026-09-18 05:14:50 +03:00
parent 5ac4db438d
commit 45bc352d46
88 changed files with 12606 additions and 504 deletions
+13
View File
@@ -5,6 +5,19 @@
#include <string_view>
namespace faset {
// Text/JSON/process arguments use UTF-8. Keep filesystem paths in native form
// internally; narrow path constructors/string() depend on the Windows code page.
std::filesystem::path path_from_utf8(std::string_view text);
std::string path_to_utf8(const std::filesystem::path& path);
std::string generic_path_to_utf8(const std::filesystem::path& path);
// Use only at file-I/O boundaries, never for serialized paths or identity comparisons.
// Windows: absolute, normalized extended-length path; other systems: unchanged.
std::filesystem::path native_io_path(const std::filesystem::path& path);
#ifdef _WIN32
// Thin wmain adapter: preserve the CRT's Unicode argument parsing and pass UTF-8
// to the shared application entry. No process/global code-page change is needed.
int run_utf8_main(int argc, wchar_t** argv, int (*entry)(int, char**)) noexcept;
#endif
std::string new_id();
std::string read_text(const std::filesystem::path& path);
Json read_json(const std::filesystem::path& path);
+3 -2
View File
@@ -8,10 +8,11 @@
namespace faset {
struct ProcessOptions {
// First element is the executable. Arguments are passed directly, never through a shell.
// UTF-8 text; the first element is the executable (use path_to_utf8 for paths).
// Arguments are passed directly, never through a shell.
std::vector<std::string> arguments;
std::filesystem::path working_directory;
std::map<std::string, std::string> environment;
std::map<std::string, std::string> environment; // UTF-8 names and values.
};
struct ProcessPoll {
bool running{};