MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / read_file_data

Function read_file_data

src/spellers/HunspellInterface.cpp:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41std::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
57void update_word_count(const wchar_t *dictionary_path) {
58 if (!dictionary_path || !PathFileExists(dictionary_path))

Callers 1

update_word_countFunction · 0.85

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected