Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: tools/skpdiff/skpdiff_util.cpp

Issue 428443002: Cleanup: Rename SkOSPath functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/skpdiff/SkDiffContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID 8 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID
9 # include <unistd.h> 9 # include <unistd.h>
10 # include <sys/time.h> 10 # include <sys/time.h>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 DIR* dir = opendir(path); 110 DIR* dir = opendir(path);
111 if (NULL == dir) { 111 if (NULL == dir) {
112 return false; 112 return false;
113 } 113 }
114 114
115 // Loop through dir entries until there are none left (i.e. readdir returns NULL) 115 // Loop through dir entries until there are none left (i.e. readdir returns NULL)
116 struct dirent* entry; 116 struct dirent* entry;
117 while ((entry = readdir(dir))) { 117 while ((entry = readdir(dir))) {
118 // dirent only gives relative paths, we need to join them to the base pa th to check if they 118 // dirent only gives relative paths, we need to join them to the base pa th to check if they
119 // are directories. 119 // are directories.
120 SkString joinedPath = SkOSPath::SkPathJoin(path, entry->d_name); 120 SkString joinedPath = SkOSPath::Join(path, entry->d_name);
121 121
122 // We only care about files 122 // We only care about files
123 if (!sk_isdir(joinedPath.c_str())) { 123 if (!sk_isdir(joinedPath.c_str())) {
124 entries->push_back(SkString(entry->d_name)); 124 entries->push_back(SkString(entry->d_name));
125 } 125 }
126 } 126 }
127 127
128 closedir(dir); 128 closedir(dir);
129 129
130 return true; 130 return true;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 #elif SK_BUILD_FOR_WIN32 197 #elif SK_BUILD_FOR_WIN32
198 SkString fullPath(MAX_PATH); 198 SkString fullPath(MAX_PATH);
199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) { 199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) {
200 fullPath.reset(); 200 fullPath.reset();
201 } 201 }
202 return fullPath; 202 return fullPath;
203 #else 203 #else
204 return SkString(); 204 return SkString();
205 #endif 205 #endif
206 } 206 }
OLDNEW
« no previous file with comments | « tools/skpdiff/SkDiffContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698