MCPcopy Create free account
hub / github.com/BVLC/caffe / FindLastPathSeparator

Method FindLastPathSeparator

src/gtest/gtest-all.cpp:7556–7567  ·  view source on GitHub ↗

Returns a pointer to the last occurrence of a valid path separator in the FilePath. On Windows, for example, both '/' and '\' are valid path separators. Returns NULL if no path separator was found.

Source from the content-addressed store, hash-verified

7554// the FilePath. On Windows, for example, both '/' and '\' are valid path
7555// separators. Returns NULL if no path separator was found.
7556const char* FilePath::FindLastPathSeparator() const {
7557 const char* const last_sep = strrchr(c_str(), kPathSeparator);
7558#if GTEST_HAS_ALT_PATH_SEP_
7559 const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
7560 // Comparing two pointers of which only one is NULL is undefined.
7561 if (last_alt_sep != NULL &&
7562 (last_sep == NULL || last_alt_sep > last_sep)) {
7563 return last_alt_sep;
7564 }
7565#endif
7566 return last_sep;
7567}
7568
7569// Returns a copy of the FilePath with the directory part removed.
7570// Example: FilePath("path/to/file").RemoveDirectoryName() returns

Callers

nothing calls this directly

Calls 1

c_strFunction · 0.85

Tested by

no test coverage detected