Closed Tetrago closed 6 years ago
Actually, I can't even get CMakeRC to run, it errors out.
Sorry for the delay. Were you able to work out a solution?
I do
auto file = fs.open("some_resource_file.txt")
auto it = file.begin();
vector<char> bytes;
do bytes.push_back(*it);
while (it++ != file.end());
But DarthGandalf has a better (C++ 17) syntax in https://github.com/vector-of-bool/cmrc/issues/24. Comes down to:
auto file = fs.open("some_resource_file.txt")
char* data = std::string_view(file.begin(), file.end() - file.begin()).data();
I tried to use:
cmrc::resource file = cmrc::open(file); std::string data(file.begin(), file.end());
But there is no string constructor like this. How do I use CMakeRC?