| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <assert.h> | 11 #include "webrtc/base/fileutils.h" |
| 12 | 12 |
| 13 #include "webrtc/base/arraysize.h" | 13 #include "webrtc/base/arraysize.h" |
| 14 #include "webrtc/base/checks.h" |
| 14 #include "webrtc/base/pathutils.h" | 15 #include "webrtc/base/pathutils.h" |
| 15 #include "webrtc/base/fileutils.h" | |
| 16 #include "webrtc/base/stringutils.h" | 16 #include "webrtc/base/stringutils.h" |
| 17 #include "webrtc/base/stream.h" | 17 #include "webrtc/base/stream.h" |
| 18 | 18 |
| 19 #if defined(WEBRTC_WIN) | 19 #if defined(WEBRTC_WIN) |
| 20 #include "webrtc/base/win32filesystem.h" | 20 #include "webrtc/base/win32filesystem.h" |
| 21 #else | 21 #else |
| 22 #include "webrtc/base/unixfilesystem.h" | 22 #include "webrtc/base/unixfilesystem.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if !defined(WEBRTC_WIN) | 25 #if !defined(WEBRTC_WIN) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 #else | 105 #else |
| 106 return S_ISDIR(stat_.st_mode); | 106 return S_ISDIR(stat_.st_mode); |
| 107 #endif | 107 #endif |
| 108 } | 108 } |
| 109 | 109 |
| 110 // returns the name of the file currently pointed to | 110 // returns the name of the file currently pointed to |
| 111 std::string DirectoryIterator::Name() const { | 111 std::string DirectoryIterator::Name() const { |
| 112 #if defined(WEBRTC_WIN) | 112 #if defined(WEBRTC_WIN) |
| 113 return ToUtf8(data_.cFileName); | 113 return ToUtf8(data_.cFileName); |
| 114 #else | 114 #else |
| 115 assert(dirent_ != NULL); | 115 RTC_DCHECK(dirent_); |
| 116 return dirent_->d_name; | 116 return dirent_->d_name; |
| 117 #endif | 117 #endif |
| 118 } | 118 } |
| 119 | 119 |
| 120 // returns the size of the file currently pointed to | 120 // returns the size of the file currently pointed to |
| 121 size_t DirectoryIterator::FileSize() const { | 121 size_t DirectoryIterator::FileSize() const { |
| 122 #if !defined(WEBRTC_WIN) | 122 #if !defined(WEBRTC_WIN) |
| 123 return stat_.st_size; | 123 return stat_.st_size; |
| 124 #else | 124 #else |
| 125 return data_.nFileSizeLow; | 125 return data_.nFileSizeLow; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 version += 1; | 275 version += 1; |
| 276 char version_base[MAX_PATH]; | 276 char version_base[MAX_PATH]; |
| 277 sprintfn(version_base, arraysize(version_base), "%s-%u", basename.c_str(), | 277 sprintfn(version_base, arraysize(version_base), "%s-%u", basename.c_str(), |
| 278 version); | 278 version); |
| 279 path.SetBasename(version_base); | 279 path.SetBasename(version_base); |
| 280 } | 280 } |
| 281 return true; | 281 return true; |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace rtc | 284 } // namespace rtc |
| OLD | NEW |