| 129 | } |
| 130 | |
| 131 | std::string ReadAllText(const std::filesystem::path &path) { |
| 132 | std::ifstream stream(path); |
| 133 | if (!stream.good()) { |
| 134 | return ""; |
| 135 | } |
| 136 | |
| 137 | // Determine size |
| 138 | stream.seekg(0, std::ios::end); |
| 139 | std::ifstream::pos_type size = stream.tellg(); |
| 140 | |
| 141 | // Read contents |
| 142 | std::string str(static_cast<std::string::size_type>(size), ' '); |
| 143 | stream.seekg(0); |
| 144 | stream.read(&str[0], size); |
| 145 | return str; |
| 146 | } |
| 147 | |
| 148 | static bool IsPathDelim(char _char) { |
| 149 | switch (_char) { |
no outgoing calls
no test coverage detected