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

Function IsReadableFile

src/PluginSegmentation.cpp:85–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85bool IsReadableFile(const std::string& path) {
86#if defined(_WIN32) || defined(_WIN64)
87 const DWORD attributes =
88 GetFileAttributesW(internal::WideFromUtf8(path).c_str());
89 return attributes != INVALID_FILE_ATTRIBUTES &&
90 (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
91#else
92 std::ifstream ifs(path.c_str(), std::ios::binary);
93 return ifs.is_open();
94#endif
95}
96
97std::vector<std::string> SplitSearchPath(const char* raw) {
98 std::vector<std::string> entries;

Callers 1

LoadByTypeMethod · 0.70

Calls 2

WideFromUtf8Function · 0.70
is_openMethod · 0.45

Tested by

no test coverage detected