| 39 | } |
| 40 | |
| 41 | std::vector<char> read_file_data(const wchar_t *file_path) { |
| 42 | auto fp = _wfopen(file_path, L"rb"); |
| 43 | if (!fp) |
| 44 | return {}; |
| 45 | _fseeki64(fp, 0, SEEK_END); |
| 46 | auto size = static_cast<size_t>(_ftelli64(fp)); |
| 47 | std::vector<char> res(size + 1); |
| 48 | _fseeki64(fp, 0, SEEK_SET); |
| 49 | if (fread(res.data(), 1, size, fp) != size) { |
| 50 | fclose(fp); |
| 51 | return {}; |
| 52 | } |
| 53 | fclose(fp); |
| 54 | return res; |
| 55 | } |
| 56 | |
| 57 | void update_word_count(const wchar_t *dictionary_path) { |
| 58 | if (!dictionary_path || !PathFileExists(dictionary_path)) |
no test coverage detected