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

Method IsAbsolutePath

test/common/gtest/gtest.cpp:8535–8546  ·  view source on GitHub ↗

Returns true if pathname describes an absolute path.

Source from the content-addressed store, hash-verified

8533
8534// Returns true if pathname describes an absolute path.
8535bool FilePath::IsAbsolutePath() const {
8536 const char* const name = pathname_.c_str();
8537#if GTEST_OS_WINDOWS
8538 return pathname_.length() >= 3 &&
8539 ((name[0] >= 'a' && name[0] <= 'z') ||
8540 (name[0] >= 'A' && name[0] <= 'Z')) &&
8541 name[1] == ':' &&
8542 IsPathSeparator(name[2]);
8543#else
8544 return IsPathSeparator(name[0]);
8545#endif
8546}
8547
8548// Returns a pathname for a file that does not currently exist. The pathname
8549// will be directory/base_name.extension or

Callers 1

Calls 1

IsPathSeparatorFunction · 0.85

Tested by

no test coverage detected