| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/ftp/ftp_directory_listing_parser_netware.h" | 5 #include "net/ftp/ftp_directory_listing_parser_netware.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 namespace net { | 36 namespace net { |
| 37 | 37 |
| 38 bool ParseFtpDirectoryListingNetware( | 38 bool ParseFtpDirectoryListingNetware( |
| 39 const std::vector<base::string16>& lines, | 39 const std::vector<base::string16>& lines, |
| 40 const base::Time& current_time, | 40 const base::Time& current_time, |
| 41 std::vector<FtpDirectoryListingEntry>* entries) { | 41 std::vector<FtpDirectoryListingEntry>* entries) { |
| 42 if (!lines.empty() && | 42 if (!lines.empty() && |
| 43 !base::StartsWith(lines[0], base::ASCIIToUTF16("total "), true)) { | 43 !base::StartsWith(lines[0], base::ASCIIToUTF16("total "), |
| 44 base::CompareCase::SENSITIVE)) { |
| 44 return false; | 45 return false; |
| 45 } | 46 } |
| 46 | 47 |
| 47 for (size_t i = 1U; i < lines.size(); i++) { | 48 for (size_t i = 1U; i < lines.size(); i++) { |
| 48 if (lines[i].empty()) | 49 if (lines[i].empty()) |
| 49 continue; | 50 continue; |
| 50 | 51 |
| 51 std::vector<base::string16> columns; | 52 std::vector<base::string16> columns; |
| 52 base::SplitString(base::CollapseWhitespace(lines[i], false), ' ', &columns); | 53 base::SplitString(base::CollapseWhitespace(lines[i], false), ' ', &columns); |
| 53 | 54 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 88 |
| 88 entry.name = FtpUtil::GetStringPartAfterColumns(lines[i], 7); | 89 entry.name = FtpUtil::GetStringPartAfterColumns(lines[i], 7); |
| 89 | 90 |
| 90 entries->push_back(entry); | 91 entries->push_back(entry); |
| 91 } | 92 } |
| 92 | 93 |
| 93 return true; | 94 return true; |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace net | 97 } // namespace net |
| OLD | NEW |