MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / TryLoadFromFile

Function TryLoadFromFile

src/SerializableDict.hpp:52–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51 template <typename DICT>
52 static bool TryLoadFromFile(const std::string& fileName,
53 std::shared_ptr<DICT>* dict) {
54 FILE* fp = OpenSerializableFileUtf8(fileName, "rb");
55
56 if (fp == NULL) {
57 return false;
58 }
59 std::shared_ptr<DICT> loadedDict = DICT::NewFromFile(fp);
60 fclose(fp);
61 *dict = loadedDict;
62 return true;
63 }
64
65 template <typename DICT>
66 static std::shared_ptr<DICT> NewFromFile(const std::string& fileName) {

Callers

nothing calls this directly

Calls 2

OpenSerializableFileUtf8Function · 0.85
NewFromFileFunction · 0.85

Tested by

no test coverage detected