| 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_vms.h" | 5 #include "net/ftp/ftp_directory_listing_parser_vms.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 std::vector<string16> columns; | 211 std::vector<string16> columns; |
| 212 base::SplitString(CollapseWhitespace(lines[i], false), ' ', &columns); | 212 base::SplitString(CollapseWhitespace(lines[i], false), ' ', &columns); |
| 213 | 213 |
| 214 if (columns.size() == 1) { | 214 if (columns.size() == 1) { |
| 215 // There can be no continuation if the current line is the last one. | 215 // There can be no continuation if the current line is the last one. |
| 216 if (i == lines.size() - 1) | 216 if (i == lines.size() - 1) |
| 217 return false; | 217 return false; |
| 218 | 218 |
| 219 // Join the current and next line and split them into columns. | 219 // Join the current and next line and split them into columns. |
| 220 columns.clear(); | |
| 221 base::SplitString( | 220 base::SplitString( |
| 222 CollapseWhitespace(lines[i] + ASCIIToUTF16(" ") + lines[i + 1], | 221 CollapseWhitespace(lines[i] + ASCIIToUTF16(" ") + lines[i + 1], |
| 223 false), | 222 false), |
| 224 ' ', | 223 ' ', |
| 225 &columns); | 224 &columns); |
| 226 i++; | 225 i++; |
| 227 } | 226 } |
| 228 | 227 |
| 229 FtpDirectoryListingEntry entry; | 228 FtpDirectoryListingEntry entry; |
| 230 if (!ParseVmsFilename(columns[0], &entry.name, &entry.type)) | 229 if (!ParseVmsFilename(columns[0], &entry.name, &entry.type)) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 257 | 256 |
| 258 entries->push_back(entry); | 257 entries->push_back(entry); |
| 259 } | 258 } |
| 260 | 259 |
| 261 // The only place where we return true is after receiving the "Total" line, | 260 // The only place where we return true is after receiving the "Total" line, |
| 262 // that should be present in every VMS listing. | 261 // that should be present in every VMS listing. |
| 263 return false; | 262 return false; |
| 264 } | 263 } |
| 265 | 264 |
| 266 } // namespace net | 265 } // namespace net |
| OLD | NEW |