MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / IsAbsolutePath

Method IsAbsolutePath

tests/gtest/gtest-all.cc:9495–9506  ·  view source on GitHub ↗

Returns true if pathname describes an absolute path.

Source from the content-addressed store, hash-verified

9493
9494// Returns true if pathname describes an absolute path.
9495bool FilePath::IsAbsolutePath() const {
9496 const char* const name = pathname_.c_str();
9497#if GTEST_OS_WINDOWS
9498 return pathname_.length() >= 3 &&
9499 ((name[0] >= 'a' && name[0] <= 'z') ||
9500 (name[0] >= 'A' && name[0] <= 'Z')) &&
9501 name[1] == ':' &&
9502 IsPathSeparator(name[2]);
9503#else
9504 return IsPathSeparator(name[0]);
9505#endif
9506}
9507
9508// Returns a pathname for a file that does not currently exist. The pathname
9509// will be directory/base_name.extension or

Callers 1

Calls 1

IsPathSeparatorFunction · 0.85

Tested by

no test coverage detected