Mercurial > minori
diff dep/animia/src/util.cc @ 161:71752dcbb49f
junk: clunky merge commit
maybe I should enable rebase on this repo
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 17 Nov 2023 13:09:20 -0500 |
parents | 80d6b28eb29f |
children |
line wrap: on
line diff
--- a/dep/animia/src/util.cc Fri Nov 17 12:37:31 2023 -0500 +++ b/dep/animia/src/util.cc Fri Nov 17 13:09:20 2023 -0500 @@ -10,16 +10,14 @@ bool ReadFile(const std::string& path, std::string& data) { std::ifstream file(path.c_str(), std::ios::in | std::ios::binary); - if (!file) return false; - file.seekg(0, std::ios::end); - data.resize(static_cast<size_t>(file.tellg())); - file.seekg(0, std::ios::beg); + std::ostringstream string; + string << file.rdbuf(); + file.close(); - file.read(&data.front(), data.size()); - file.close(); + data = string.str(); return true; }