| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #endif | 9 #endif |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 FILE* CreateAndOpenTemporaryFile(FilePath* path) { | 179 FILE* CreateAndOpenTemporaryFile(FilePath* path) { |
| 180 FilePath directory; | 180 FilePath directory; |
| 181 if (!GetTempDir(&directory)) | 181 if (!GetTempDir(&directory)) |
| 182 return NULL; | 182 return NULL; |
| 183 | 183 |
| 184 return CreateAndOpenTemporaryFileInDir(directory, path); | 184 return CreateAndOpenTemporaryFileInDir(directory, path); |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool GetFileSize(const FilePath& file_path, int64* file_size) { | 187 bool GetFileSize(const FilePath& file_path, int64* file_size) { |
| 188 FileInfo info; | 188 base::PlatformFileInfo info; |
| 189 if (!GetFileInfo(file_path, &info)) | 189 if (!GetFileInfo(file_path, &info)) |
| 190 return false; | 190 return false; |
| 191 *file_size = info.size; | 191 *file_size = info.size; |
| 192 return true; | 192 return true; |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool IsDot(const FilePath& path) { | 195 bool IsDot(const FilePath& path) { |
| 196 return FILE_PATH_LITERAL(".") == path.BaseName().value(); | 196 return FILE_PATH_LITERAL(".") == path.BaseName().value(); |
| 197 } | 197 } |
| 198 | 198 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // FileEnumerator | 398 // FileEnumerator |
| 399 // | 399 // |
| 400 // Note: the main logic is in file_util_<platform>.cc | 400 // Note: the main logic is in file_util_<platform>.cc |
| 401 | 401 |
| 402 bool FileEnumerator::ShouldSkip(const FilePath& path) { | 402 bool FileEnumerator::ShouldSkip(const FilePath& path) { |
| 403 FilePath::StringType basename = path.BaseName().value(); | 403 FilePath::StringType basename = path.BaseName().value(); |
| 404 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); | 404 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace | 407 } // namespace |
| OLD | NEW |