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

Function IsRegularFile

plugins/jieba/src/JiebaSegmentation.cpp:90–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90bool IsRegularFile(const std::string& path) {
91#if defined(_WIN32) || defined(_WIN64)
92 const DWORD attributes = GetFileAttributesW(LocalWideFromUtf8(path).c_str());
93 return attributes != INVALID_FILE_ATTRIBUTES &&
94 (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
95#else
96 struct stat info;
97 if (stat(path.c_str(), &info) != 0) {
98 return false;
99 }
100 return (info.st_mode & S_IFMT) == S_IFREG;
101#endif
102}
103
104std::string ResolveAuxPath(const std::string& dictPath,
105 const std::string& modelPath,

Callers 1

ResolveAuxPathFunction · 0.70

Calls 2

LocalWideFromUtf8Function · 0.70
statClass · 0.70

Tested by

no test coverage detected