MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / IsAbsolutePath

Method IsAbsolutePath

cpp/test/src/gtest-filepath.cc:265–276  ·  view source on GitHub ↗

Returns true if pathname describes an absolute path.

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

IsPathSeparatorFunction · 0.85
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected