| 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_hprc.h" | 5 #include "net/ftp/ftp_directory_listing_parser_hprc.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 FtpDirectoryListingParserHprc::FtpDirectoryListingParserHprc( | 12 FtpDirectoryListingParserHprc::FtpDirectoryListingParserHprc( |
| 13 const base::Time& current_time) | 13 const base::Time& current_time) |
| 14 : current_time_(current_time) { | 14 : current_time_(current_time) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 FtpDirectoryListingParserHprc::~FtpDirectoryListingParserHprc() {} |
| 18 |
| 17 FtpServerType FtpDirectoryListingParserHprc::GetServerType() const { | 19 FtpServerType FtpDirectoryListingParserHprc::GetServerType() const { |
| 18 return SERVER_HPRC; | 20 return SERVER_HPRC; |
| 19 } | 21 } |
| 20 | 22 |
| 21 bool FtpDirectoryListingParserHprc::ConsumeLine(const string16& line) { | 23 bool FtpDirectoryListingParserHprc::ConsumeLine(const string16& line) { |
| 22 if (line.empty()) | 24 if (line.empty()) |
| 23 return false; | 25 return false; |
| 24 | 26 |
| 25 // All lines begin with a space. | 27 // All lines begin with a space. |
| 26 if (line[0] != ' ') | 28 if (line[0] != ' ') |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 } | 51 } |
| 50 | 52 |
| 51 FtpDirectoryListingEntry FtpDirectoryListingParserHprc::PopEntry() { | 53 FtpDirectoryListingEntry FtpDirectoryListingParserHprc::PopEntry() { |
| 52 DCHECK(EntryAvailable()); | 54 DCHECK(EntryAvailable()); |
| 53 FtpDirectoryListingEntry entry = entries_.front(); | 55 FtpDirectoryListingEntry entry = entries_.front(); |
| 54 entries_.pop(); | 56 entries_.pop(); |
| 55 return entry; | 57 return entry; |
| 56 } | 58 } |
| 57 | 59 |
| 58 } // namespace net | 60 } // namespace net |
| OLD | NEW |