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

Function isRegularFile

src/Config.cpp:701–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701bool isRegularFile(const std::string& path) {
702#if defined(_WIN32) || defined(_WIN64)
703 const DWORD attributes = GetFileAttributesW(WideFromUtf8(path).c_str());
704 return attributes != INVALID_FILE_ATTRIBUTES &&
705 (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
706#else
707 struct stat info;
708 if (stat(path.c_str(), &info) != 0) {
709 return false;
710 }
711 return (info.st_mode & S_IFMT) == S_IFREG;
712#endif
713}
714
715std::shared_ptr<ResourceProvider>
716NewFilesystemResourceProvider(const std::string& configDirectory,

Callers 1

NewFromFileMethod · 0.85

Calls 2

WideFromUtf8Function · 0.70
statClass · 0.70

Tested by

no test coverage detected