MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / IsRootDirectory

Method IsRootDirectory

test/common/gtest/gtest.cpp:8523–8532  ·  view source on GitHub ↗

Returns true if pathname describes a root directory. (Windows has one root directory per disk drive.)

Source from the content-addressed store, hash-verified

8521// Returns true if pathname describes a root directory. (Windows has one
8522// root directory per disk drive.)
8523bool FilePath::IsRootDirectory() const {
8524#if GTEST_OS_WINDOWS
8525 // TODO(wan@google.com): on Windows a network share like
8526 // \\server\share can be a root directory, although it cannot be the
8527 // current directory. Handle this properly.
8528 return pathname_.length() == 3 && IsAbsolutePath();
8529#else
8530 return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
8531#endif
8532}
8533
8534// Returns true if pathname describes an absolute path.
8535bool FilePath::IsAbsolutePath() const {

Callers

nothing calls this directly

Calls 1

IsPathSeparatorFunction · 0.85

Tested by

no test coverage detected