|
static error | initialize (const std::wstring_view application_name, const std::wstring_view assets_path=default_assets_directory_name) |
| Initialize the Resource Manager.
|
|
static void | set_application_name (const std::wstring_view application_name) noexcept |
| Sets the application name object.
|
|
static void | associate (std::wstring_view protocol, std::wstring &&prefix) noexcept |
| Add the association between the protocol and the prefix. (ex. L"res://" and L"user://")
|
|
static std::vector< byte > | read_binary (const std::wstring_view path) |
| Read whole binary file.
|
|
static std::string | read_text (const std::wstring_view path) |
| Read whole text file.
|
|
template<class Custom > |
static auto | read_binary (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, Custom > |
| Construct Custom class by binary data from file.
|
|
template<class Custom > |
static auto | read_text (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, Custom > |
| Construct Custom class by text data from file.
|
|
template<class Custom > |
static auto | read_shared_binary (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, std::shared_ptr< Custom > > |
| Construct std::shared_ptr<Custom> by binary data from file.
|
|
template<class Custom > |
static auto | read_shared_text (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, std::shared_ptr< Custom > > |
| Construct std::shared_ptr<Custom> by binary data from file.
|
|
template<class Custom > |
static auto | read_unique_binary (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, std::unique_ptr< Custom > > |
| Construct std::shared_ptr<Custom> by binary data from file.
|
|
template<class Custom > |
static auto | read_unique_text (const std::wstring_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, std::unique_ptr< Custom > > |
| Construct std::shared_ptr<Custom> by binary data from file.
|
|
static error | write_binary (const std::wstring_view path, const details::data_view< byte > &data) |
| Write binary data to a file.
|
|
static error | write_binary (const std::wstring_view path, const std::initializer_list< byte > data) |
| Write binary data to a file.
|
|
static error | append_binary (const std::wstring_view path, const details::data_view< byte > &data) |
| Append binary data to a file.
|
|
static error | append_binary (const std::wstring_view path, const std::initializer_list< byte > data) |
| Append binary data to a file.
|
|
static error | write_text (const std::wstring_view path, const std::string_view text) |
| Write text data to a file.
|
|
static error | append_text (const std::wstring_view path, const std::string_view text) |
| Append text data to a file.
|
|
static error | write_text (const std::wstring_view path, const std::wstring_view text) |
| Write text data to a file.
|
|
static error | append_text (const std::wstring_view path, const std::wstring_view text) |
| Append text data to a file.
|
|
static std::wstring_view | get_association (const std::wstring_view protocol) noexcept |
| Get the association object.
|
|
static std::wstring_view | application_name () noexcept |
| Get the application name.
|
|
static std::wstring_view | user_data_directory () noexcept |
| Get the user data directory object.
|
|
static std::wstring_view | assets_directory () noexcept |
| Get the assets directories.
|
|
static const associations_type & | associations () noexcept |
| Get the associations.
|
|
static void | join (std::wstring &left, std::wstring_view right) noexcept |
| Join two paths with a slash.
|
|
static std::wstring | join (std::wstring_view left, std::wstring_view right) noexcept |
| Join two paths with a slash.
|
|
static void | parent_directory (std::wstring &path) noexcept |
| Remove the last path component.
|
|
static std::wstring | parent_directory (std::wstring_view path) noexcept |
| Remove the last path component.
|
|
static std::wstring | normalize (std::wstring_view path) |
| Fix the path separators to the '/' and remove the trailing slash.
|
|
static bool | exists (const std::wstring_view path) noexcept |
| Check if an entry exists.
|
|
static bool | is_file (const std::wstring_view path) |
| Check if an entry is a file.
|
|
static bool | is_directory (const std::wstring_view path) |
| Check if an entry is a directory.
|
|
static error | make_directory (const std::wstring_view path) |
| Create a directory (recursively).
|
|
static error | remove_directory (const std::wstring_view path) |
| Remove a directory (recursively).
|
|
static error | remove_file (const std::wstring_view path) |
| Remove a file.
|
|
static error | remove (const std::wstring_view path) |
| List an entry (file or directory).
|
|
static std::wstring | current_directory () |
| Get the absolute path of this application.
|
|
static std::vector< std::wstring > | entries (const std::wstring_view path) |
| Get all entries in a directory.
|
|
static std::wstring | to_wide (const std::string_view str) noexcept |
| Convert a string to wide string.
|
|
static std::string | to_narrow (const std::wstring_view wstr) noexcept |
| Convert a wide string to string.
|
|
static error | initialize (const std::string_view application_name, const std::string_view assets_path=default_assets_directory_name_narrow) |
| Narrow string alias for golxzn::os::filesystem::initialize(const std::wstring_view, const std::wstring_view)
|
|
static void | set_application_name (const std::string_view application_name) noexcept |
| Narrow string alias for golxzn::os::filesystem::set_application_name(const std::wstring_view)
|
|
static void | associate (const std::string_view protocol, const std::string_view prefix) noexcept |
| Narrow string alias for golxzn::os::filesystem::associate(const std::wstring_view, const std::wstring_view)
|
|
static std::vector< byte > | read_binary (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::read_binary(const std::wstring_view path)
|
|
static std::string | read_text (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::read_text(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_binary (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, Custom > |
| Narrow string alias for golxzn::os::filesystem::read_binary(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_text (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, Custom > |
| Narrow string alias for golxzn::os::filesystem::read_text(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_shared_binary (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, std::shared_ptr< Custom > > |
| Narrow string alias for golxzn::os::filesystem::read_shared_binary(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_shared_text (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, std::shared_ptr< Custom > > |
| Narrow string alias for golxzn::os::filesystem::read_shared_text(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_unique_binary (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::vector< byte > >, std::unique_ptr< Custom > > |
| Narrow string alias for golxzn::os::filesystem::read_unique_binary(const std::wstring_view path)
|
|
template<class Custom > |
static auto | read_unique_text (const std::string_view path) -> std::enable_if_t< std::is_constructible_v< Custom, std::string >, std::unique_ptr< Custom > > |
| Narrow string alias for golxzn::os::filesystem::read_unique_text(const std::wstring_view path)
|
|
static error | write_binary (const std::string_view path, const details::data_view< byte > &data) |
| Narrow string alias for golxzn::os::filesystem::write_binary(const std::wstring_view path, const details::data_view<byte> &data)
|
|
static error | write_binary (const std::string_view path, const std::initializer_list< byte > data) |
| Narrow string alias for golxzn::os::filesystem::write_binary(const std::wstring_view path, const std::initializer_list<byte> data)
|
|
static error | append_binary (const std::string_view path, const details::data_view< byte > &data) |
| Narrow string alias for golxzn::os::filesystem::append_binary(const std::wstring_view path, const details::data_view<byte> &data)
|
|
static error | append_binary (const std::string_view path, const std::initializer_list< byte > data) |
| Narrow string alias for golxzn::os::filesystem::append_binary(const std::wstring_view path, const std::initializer_list<byte> data)
|
|
static error | write_text (const std::string_view path, const std::string_view text) |
| Narrow string alias for golxzn::os::filesystem::write_text(const std::wstring_view path, const std::string_view text)
|
|
static error | append_text (const std::string_view path, const std::string_view text) |
| Narrow string alias for golxzn::os::filesystem::append_text(const std::wstring_view path, const std::string_view text)
|
|
static error | write_text (const std::string_view path, const std::wstring_view text) |
| Narrow string alias for golxzn::os::filesystem::write_text(const std::wstring_view path, const std::wstring_view text)
|
|
static error | append_text (const std::string_view path, const std::wstring_view text) |
| Narrow string alias for golxzn::os::filesystem::append_text(const std::wstring_view path, const std::wstring_view text)
|
|
static std::wstring_view | get_association (const std::string_view protocol) noexcept |
| Narrow string alias for golxzn::os::filesystem::get_association(const std::wstring_view protocol)
|
|
static void | join (std::string &left, std::string_view right) noexcept |
| Narrow string alias for golxzn::os::filesystem::join(std::wstring &left, std::wstring_view right)
|
|
static std::string | join (std::string_view left, std::string_view right) noexcept |
| Narrow string alias for golxzn::os::filesystem::join(std::wstring_view left, std::wstring_view right)
|
|
static void | parent_directory (std::string &path) noexcept |
| Narrow string alias for golxzn::os::filesystem::parent_directory(std::wstring &path)
|
|
static std::string | parent_directory (std::string_view path) noexcept |
| Narrow string alias for golxzn::os::filesystem::parent_directory(std::wstring_view path)
|
|
static std::wstring | normalize (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::normalize(const std::wstring_view path)
|
|
static bool | exists (const std::string_view path) noexcept |
| Narrow string alias for golxzn::os::filesystem::exists(const std::wstring_view path)
|
|
static bool | is_file (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::is_file(const std::wstring_view path)
|
|
static bool | is_directory (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::is_directory(const std::wstring_view path)
|
|
static error | make_directory (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::make_directory(const std::wstring_view path)
|
|
static error | remove_directory (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::remove_directory(const std::wstring_view path)
|
|
static error | remove_file (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::remove_file(const std::wstring_view path)
|
|
static error | remove (const std::string_view path) |
| Narrow string alias for golxzn::os::filesystem::remove(const std::wstring_view path)
|
|
static std::vector< std::string > | entries (const std::string_view path) |
| Narrow stirng alias for golxzn::os::filesystem::entries(const std::wstring_view path)
|
|
Golxzn Resource Manager.
Use this class to load resources from the program's directory.
- Warning
- Every methods with string arguments instead of wstring cause a memory allocation.