OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/files/file_enumerator.h" | 5 #include "base/files/file_enumerator.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 } | 23 } |
24 | 24 |
25 FilePath FileEnumerator::FileInfo::GetName() const { | 25 FilePath FileEnumerator::FileInfo::GetName() const { |
26 return FilePath(find_data_.cFileName); | 26 return FilePath(find_data_.cFileName); |
27 } | 27 } |
28 | 28 |
29 int64 FileEnumerator::FileInfo::GetSize() const { | 29 int64 FileEnumerator::FileInfo::GetSize() const { |
30 ULARGE_INTEGER size; | 30 ULARGE_INTEGER size; |
31 size.HighPart = find_data_.nFileSizeHigh; | 31 size.HighPart = find_data_.nFileSizeHigh; |
32 size.LowPart = find_data_.nFileSizeLow; | 32 size.LowPart = find_data_.nFileSizeLow; |
33 DCHECK_LE(size.QuadPart, std::numeric_limits<int64>::max()); | 33 DCHECK_LE(size.QuadPart, |
34 static_cast<ULONGLONG>(std::numeric_limits<int64>::max())); | |
Nico
2015/07/20 23:39:27
Does std::numeric_limits<ULONGLONG>::max() not wor
Peter Kasting
2015/07/20 23:45:50
That's not correct. We're going to cast a ULONGLO
Nico
2015/07/20 23:48:09
Ah, I see.
| |
34 return static_cast<int64>(size.QuadPart); | 35 return static_cast<int64>(size.QuadPart); |
35 } | 36 } |
36 | 37 |
37 base::Time FileEnumerator::FileInfo::GetLastModifiedTime() const { | 38 base::Time FileEnumerator::FileInfo::GetLastModifiedTime() const { |
38 return base::Time::FromFileTime(find_data_.ftLastWriteTime); | 39 return base::Time::FromFileTime(find_data_.ftLastWriteTime); |
39 } | 40 } |
40 | 41 |
41 // FileEnumerator -------------------------------------------------------------- | 42 // FileEnumerator -------------------------------------------------------------- |
42 | 43 |
43 FileEnumerator::FileEnumerator(const FilePath& root_path, | 44 FileEnumerator::FileEnumerator(const FilePath& root_path, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 return cur_file; | 156 return cur_file; |
156 } else if (file_type_ & FileEnumerator::FILES) { | 157 } else if (file_type_ & FileEnumerator::FILES) { |
157 return cur_file; | 158 return cur_file; |
158 } | 159 } |
159 } | 160 } |
160 | 161 |
161 return FilePath(); | 162 return FilePath(); |
162 } | 163 } |
163 | 164 |
164 } // namespace base | 165 } // namespace base |
OLD | NEW |