OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 namespace net { | 35 namespace net { |
36 | 36 |
37 FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware( | 37 FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware( |
38 const base::Time& current_time) | 38 const base::Time& current_time) |
39 : received_first_line_(false), | 39 : received_first_line_(false), |
40 current_time_(current_time) { | 40 current_time_(current_time) { |
41 } | 41 } |
42 | 42 |
43 FtpDirectoryListingParserNetware::~FtpDirectoryListingParserNetware() {} | 43 FtpDirectoryListingParserNetware::~FtpDirectoryListingParserNetware() {} |
44 | 44 |
| 45 FtpServerType FtpDirectoryListingParserNetware::GetServerType() const { |
| 46 return SERVER_NETWARE; |
| 47 } |
| 48 |
45 bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) { | 49 bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) { |
46 if (!received_first_line_) { | 50 if (!received_first_line_) { |
47 received_first_line_ = true; | 51 received_first_line_ = true; |
48 | 52 |
49 return StartsWith(line, ASCIIToUTF16("total "), true); | 53 return StartsWith(line, ASCIIToUTF16("total "), true); |
50 } | 54 } |
51 | 55 |
52 std::vector<string16> columns; | 56 std::vector<string16> columns; |
53 base::SplitString(CollapseWhitespace(line, false), ' ', &columns); | 57 base::SplitString(CollapseWhitespace(line, false), ' ', &columns); |
54 | 58 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 return !entries_.empty(); | 104 return !entries_.empty(); |
101 } | 105 } |
102 | 106 |
103 FtpDirectoryListingEntry FtpDirectoryListingParserNetware::PopEntry() { | 107 FtpDirectoryListingEntry FtpDirectoryListingParserNetware::PopEntry() { |
104 FtpDirectoryListingEntry entry = entries_.front(); | 108 FtpDirectoryListingEntry entry = entries_.front(); |
105 entries_.pop(); | 109 entries_.pop(); |
106 return entry; | 110 return entry; |
107 } | 111 } |
108 | 112 |
109 } // namespace net | 113 } // namespace net |
OLD | NEW |