MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / IsAbsolutePath

Method IsAbsolutePath

tests/gtest/src/gtest-filepath.cc:259–270  ·  view source on GitHub ↗

Returns true if pathname describes an absolute path.

Source from the content-addressed store, hash-verified

257
258// Returns true if pathname describes an absolute path.
259bool FilePath::IsAbsolutePath() const {
260 const char* const name = pathname_.c_str();
261#if GTEST_OS_WINDOWS
262 return pathname_.length() >= 3 &&
263 ((name[0] >= 'a' && name[0] <= 'z') ||
264 (name[0] >= 'A' && name[0] <= 'Z')) &&
265 name[1] == ':' &&
266 IsPathSeparator(name[2]);
267#else
268 return IsPathSeparator(name[0]);
269#endif
270}
271
272// Returns a pathname for a file that does not currently exist. The pathname
273// will be directory/base_name.extension or

Callers 1

Calls 3

IsPathSeparatorFunction · 0.70
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected