Lines Matching refs:path
19 bool PathService::EndsWithSeparator(const std::string& path) { in EndsWithSeparator() argument
20 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR; in EndsWithSeparator()
24 bool PathService::GetExecutableDir(std::string* path) { in GetExecutableDir() argument
32 *path = std::string(path_buffer); in GetExecutableDir()
34 FXSYS_assert(path); in GetExecutableDir()
40 path->reserve(path_length); in GetExecutableDir()
41 path->resize(path_length - 1); in GetExecutableDir()
42 if (_NSGetExecutablePath(&((*path)[0]), &path_length)) in GetExecutableDir()
51 *path = std::string(buf, count); in GetExecutableDir()
55 std::size_t pos = path->size() - 1; in GetExecutableDir()
56 if (EndsWithSeparator(*path)) in GetExecutableDir()
58 std::size_t found = path->find_last_of(PATH_SEPARATOR, pos); in GetExecutableDir()
61 path->resize(found); in GetExecutableDir()
66 bool PathService::GetSourceDir(std::string* path) { in GetSourceDir() argument
67 if (!GetExecutableDir(path)) in GetSourceDir()
70 if (!EndsWithSeparator(*path)) in GetSourceDir()
71 path->push_back(PATH_SEPARATOR); in GetSourceDir()
72 path->append(".."); in GetSourceDir()
73 path->push_back(PATH_SEPARATOR); in GetSourceDir()
74 path->append(".."); in GetSourceDir()
79 bool PathService::GetTestDataDir(std::string* path) { in GetTestDataDir() argument
80 if (!GetSourceDir(path)) in GetTestDataDir()
83 if (!EndsWithSeparator(*path)) in GetTestDataDir()
84 path->push_back(PATH_SEPARATOR); in GetTestDataDir()
85 path->append("testing"); in GetTestDataDir()
86 path->push_back(PATH_SEPARATOR); in GetTestDataDir()
87 path->append("resources"); in GetTestDataDir()
93 std::string* path) { in GetTestFilePath() argument
94 if (!GetTestDataDir(path)) in GetTestFilePath()
97 if (!EndsWithSeparator(*path)) in GetTestFilePath()
98 path->push_back(PATH_SEPARATOR); in GetTestFilePath()
99 path->append(file_name); in GetTestFilePath()