#pragma once #include "common/types.h" #include #include #include #include namespace Host { /// Reads a file from the resources directory of the application. /// This may be outside of the "normal" filesystem on platforms such as Mac. std::optional> ReadResourceFile(const char* filename); /// Reads a resource file file from the resources directory as a string. std::optional ReadResourceFileToString(const char* filename); /// Adds OSD messages, duration is in seconds. void AddOSDMessage(std::string message, float duration = 2.0f); void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f); void AddFormattedOSDMessage(float duration, const char* format, ...); void AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...); void RemoveKeyedOSDMessage(std::string key); void ClearOSDMessages(); /// Displays an asynchronous error on the UI thread, i.e. doesn't block the caller. void ReportErrorAsync(const std::string_view& title, const std::string_view& message); void ReportFormattedErrorAsync(const std::string_view& title, const char* format, ...); } // namespace Host