MCPcopy Create free account
hub / github.com/apache/singa / IsAbsolutePath

Method IsAbsolutePath

test/gtest/gtest-all.cc:8094–8105  ·  view source on GitHub ↗

Returns true if pathname describes an absolute path.

Source from the content-addressed store, hash-verified

8092
8093// Returns true if pathname describes an absolute path.
8094bool FilePath::IsAbsolutePath() const {
8095 const char* const name = pathname_.c_str();
8096#if GTEST_OS_WINDOWS
8097 return pathname_.length() >= 3 &&
8098 ((name[0] >= 'a' && name[0] <= 'z') ||
8099 (name[0] >= 'A' && name[0] <= 'Z')) &&
8100 name[1] == ':' &&
8101 IsPathSeparator(name[2]);
8102#else
8103 return IsPathSeparator(name[0]);
8104#endif
8105}
8106
8107// Returns a pathname for a file that does not currently exist. The pathname
8108// will be directory/base_name.extension or

Callers 1

Calls 1

IsPathSeparatorFunction · 0.85

Tested by

no test coverage detected