OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #include <time.h> | 10 #include <time.h> |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 670 |
671 // Construct the absolute filename. | 671 // Construct the absolute filename. |
672 cur_file.insert(0, root_path_); | 672 cur_file.insert(0, root_path_); |
673 | 673 |
674 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { | 674 if (find_data_.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { |
675 if (recursive_) { | 675 if (recursive_) { |
676 // If |cur_file| is a directory, and we are doing recursive searching, add | 676 // If |cur_file| is a directory, and we are doing recursive searching, add |
677 // it to pending_paths_ so we scan it after we finish scanning this | 677 // it to pending_paths_ so we scan it after we finish scanning this |
678 // directory. | 678 // directory. |
679 pending_paths_.push(cur_file); | 679 pending_paths_.push(cur_file); |
680 return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next(); | |
681 } | 680 } |
682 | 681 return (file_type_ & FileEnumerator::DIRECTORIES) ? cur_file : Next(); |
683 if ((file_type_ & FileEnumerator::DIRECTORIES) == 0) | |
684 return Next(); | |
685 } | 682 } |
686 return (file_type_ & FileEnumerator::FILES) ? cur_file : Next(); | 683 return (file_type_ & FileEnumerator::FILES) ? cur_file : Next(); |
687 } | 684 } |
688 | 685 |
689 } // namespace file_util | 686 } // namespace file_util |
OLD | NEW |