golxzn::os::filesystem
is a simple resource manager which provides basic access to application resources
and user directory.
golxzn::os::filesystem
is dependenceless. There's only STL usage and platform specific headers.
When you initialize this library using golxzn::os::filesystem::initialize
method, library does 2 thing:
- Looks for
assets
orres
directory starting from current application directory; - Creates application directory
This library goes up to the root directory and checks assets
or res
directory to set read-only
resources directory up
This library creates application directory for data which could be modified at:
- For Linux:
/home/you/.config/your_app_name
; - For Windows:
%APPDATA%/your_app_name
; - For MacOS:
/Users/you/Library/Application Support/your_app_name
;
git clone https://github.com/golxzn/filesystem.git
add_subdirectory(filesystem)
target_link_libraries(YourProjectName PUBLIC golxzn::os::filesystem)
#include <golxzn/os/filesystem.hpp>
namespace your {
class Image {
public:
explicit YourImage(std::vector<gxzn::os::byte> &&raw_image) {
// Parse your image
}
...
};
class Settings {
public:
explicit YourSettings(std::string &&content) {
// Parse your settings
}
...
};
} // namespace your
int main() {
golxzn::os::filesystem::initialize("your_app_name");
auto app_settings{ gxzn::os::fs::load_text<your::Settings>("res://settings/application.ini") };
auto splash_screen{ ///< std::shared_ptr<your::Image>
gxzn::os::fs::load_shared_binary<your::Image>(app_settings.get_splash_screen_path())
};
}
You could use either a golxzn::os::filesystem
namespace or just gxzn::os::fs
:
golxzn::os::filesystem::initialize("your_app_name");
gxzn::os::fs::initialize("your_app_name");
Documentations is powered by: