Home | History | Annotate | Download | only in utils

Lines Matching refs:path

21 bool PathService::EndsWithSeparator(const std::string& path) {
22 return path.size() > 1 && path[path.size() - 1] == PATH_SEPARATOR;
26 bool PathService::GetExecutableDir(std::string* path) {
27 // Get the current executable file path.
34 *path = std::string(path_buffer);
36 ASSERT(path);
42 path->reserve(path_length);
43 path->resize(path_length - 1);
44 if (_NSGetExecutablePath(&((*path)[0]), &path_length))
53 *path = std::string(buf, count);
56 // Get the directory path.
57 std::size_t pos = path->size() - 1;
58 if (EndsWithSeparator(*path))
60 std::size_t found = path->find_last_of(PATH_SEPARATOR, pos);
63 path->resize(found);
68 bool PathService::GetSourceDir(std::string* path) {
69 if (!GetExecutableDir(path))
72 if (!EndsWithSeparator(*path))
73 path->push_back(PATH_SEPARATOR);
74 path->append("..");
75 path->push_back(PATH_SEPARATOR);
77 path->append("chromium_tests_root");
79 path->append("..");
85 bool PathService::GetTestDataDir(std::string* path) {
86 if (!GetSourceDir(path))
89 if (!EndsWithSeparator(*path))
90 path->push_back(PATH_SEPARATOR);
91 path->append("testing");
92 path->push_back(PATH_SEPARATOR);
93 path->append("resources");
99 std::string* path) {
100 if (!GetTestDataDir(path))
103 if (!EndsWithSeparator(*path))
104 path->push_back(PATH_SEPARATOR);
105 path->append(file_name);