#include "file.hpp" #import #include #import #include "string_utils.hpp" #include "log.hpp" void prism::set_domain_path(const prism::domain domain, const prism::path& path) { NSBundle* bundle = [NSBundle mainBundle]; NSString* resourceFolderPath = [bundle resourcePath]; std::string s = std::string(path); s = replace_substring(s, "{resource_dir}", std::string([resourceFolderPath cStringUsingEncoding:NSUTF8StringEncoding])); domain_data[(int)domain] = s; } prism::path prism::get_writeable_directory() { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString* resourceFolderPath = paths[0]; return std::string([resourceFolderPath cStringUsingEncoding:NSUTF8StringEncoding]); }