Home | History | Annotate | Download | only in utils

Lines Matching full:path

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