OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_buffer.h" | 5 #include "net/ftp/ftp_directory_listing_buffer.h" |
6 | 6 |
7 #include "base/i18n/icu_encoding_detection.h" | 7 #include "base/i18n/icu_encoding_detection.h" |
8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/ftp/ftp_directory_listing_parser_hprc.h" | |
13 #include "net/ftp/ftp_directory_listing_parser_ls.h" | 12 #include "net/ftp/ftp_directory_listing_parser_ls.h" |
14 #include "net/ftp/ftp_directory_listing_parser_mlsd.h" | |
15 #include "net/ftp/ftp_directory_listing_parser_netware.h" | 13 #include "net/ftp/ftp_directory_listing_parser_netware.h" |
16 #include "net/ftp/ftp_directory_listing_parser_vms.h" | 14 #include "net/ftp/ftp_directory_listing_parser_vms.h" |
17 #include "net/ftp/ftp_directory_listing_parser_windows.h" | 15 #include "net/ftp/ftp_directory_listing_parser_windows.h" |
18 | 16 |
19 namespace net { | 17 namespace net { |
20 | 18 |
21 FtpDirectoryListingBuffer::FtpDirectoryListingBuffer( | 19 FtpDirectoryListingBuffer::FtpDirectoryListingBuffer( |
22 const base::Time& current_time) | 20 const base::Time& current_time) |
23 : current_parser_(NULL) { | 21 : current_parser_(NULL) { |
24 parsers_.insert(new FtpDirectoryListingParserHprc(current_time)); | |
25 parsers_.insert(new FtpDirectoryListingParserLs(current_time)); | 22 parsers_.insert(new FtpDirectoryListingParserLs(current_time)); |
26 parsers_.insert(new FtpDirectoryListingParserMlsd()); | |
27 parsers_.insert(new FtpDirectoryListingParserNetware(current_time)); | 23 parsers_.insert(new FtpDirectoryListingParserNetware(current_time)); |
28 parsers_.insert(new FtpDirectoryListingParserVms()); | 24 parsers_.insert(new FtpDirectoryListingParserVms()); |
29 parsers_.insert(new FtpDirectoryListingParserWindows()); | 25 parsers_.insert(new FtpDirectoryListingParserWindows()); |
30 } | 26 } |
31 | 27 |
32 FtpDirectoryListingBuffer::~FtpDirectoryListingBuffer() { | 28 FtpDirectoryListingBuffer::~FtpDirectoryListingBuffer() { |
33 STLDeleteElements(&parsers_); | 29 STLDeleteElements(&parsers_); |
34 } | 30 } |
35 | 31 |
36 int FtpDirectoryListingBuffer::ConsumeData(const char* data, int data_length) { | 32 int FtpDirectoryListingBuffer::ConsumeData(const char* data, int data_length) { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return OK; | 185 return OK; |
190 | 186 |
191 return ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT; | 187 return ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT; |
192 } | 188 } |
193 | 189 |
194 current_parser_ = *parsers_.begin(); | 190 current_parser_ = *parsers_.begin(); |
195 return OK; | 191 return OK; |
196 } | 192 } |
197 | 193 |
198 } // namespace net | 194 } // namespace net |
OLD | NEW |