Lines Matching defs:dir
14 * Will use SkOSPath::Join to append filename to dir, test that it works correctly,
17 * @param dir String representing the path to a folder. May or may not
22 static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
29 // fullName should be "dir<SkPATH_SEPARATOR>file"
30 SkString fullName = SkOSPath::Join(dir.c_str(), filename.c_str());
32 // fullName should be the combined size of dir and file, plus one if
33 // dir did not include the final path separator.
34 size_t expectedSize = dir.size() + filename.size();
35 if (!dir.endsWith(SkPATH_SEPARATOR) && !dir.isEmpty()) {
46 // dirname should be the same as dir with any trailing seperators removed.
48 SkString strippedDir = dir;
53 SkDebugf("OOUCH %s %s %s\n", dir.c_str(), strippedDir.c_str(), dirname.c_str());
66 SkString dir("dir");
68 test_dir_with_file(reporter, dir, filename);
70 // Now make sure this works with a path separator at the end of dir.
71 dir.appendUnichar(SkPATH_SEPARATOR);
72 test_dir_with_file(reporter, dir, filename);
75 test_dir_with_file(reporter, dir, SkString());
81 dir.append("subDir");
82 test_dir_with_file(reporter, dir, filename);
85 dir.appendUnichar(SkPATH_SEPARATOR);
86 SkString baseOfDir = SkOSPath::Basename(dir.c_str());
93 // File in root dir
94 dir.printf("%c", SkPATH_SEPARATOR);
96 test_dir_with_file(reporter, dir, filename);
98 // Just the root dir
100 test_dir_with_file(reporter, dir, filename);