Easily load resources/files in C++
make
sudo make install
#include <ResourceManager.h>
#include <string>
ResourceManager::load("example.txt"); // returns true or false
ResourceManager::get("example.txt"); // returns a string
This will not read the file from the harddrive/filesystem, it will read the loaded file from the RAM.
ResourceManager::write("example.txt", "Hello World", true); // returns true or false
This will not write directly to the harddrive/filesystem, it will write to the cached/RAM file.
the third parameter is optional, if set totrue
, it will append to the file and not overwrite. (default isfalse
)
ResourceManager::save("example.txt"); // returns true or false
This will write to the harddrive/filesystem.
ResourceManager::unload("example.txt"); // returns true or false
g++ ... -lresourcemanager