| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ | 5 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ |
| 6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ | 6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // EntryAvailable returns true. | 45 // EntryAvailable returns true. |
| 46 virtual FtpDirectoryListingEntry PopEntry() = 0; | 46 virtual FtpDirectoryListingEntry PopEntry() = 0; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Parser for "ls -l"-style directory listing. | 49 // Parser for "ls -l"-style directory listing. |
| 50 class FtpLsDirectoryListingParser : public FtpDirectoryListingParser { | 50 class FtpLsDirectoryListingParser : public FtpDirectoryListingParser { |
| 51 public: | 51 public: |
| 52 FtpLsDirectoryListingParser(); | 52 FtpLsDirectoryListingParser(); |
| 53 | 53 |
| 54 // FtpDirectoryListingParser methods: | 54 // FtpDirectoryListingParser methods: |
| 55 virtual FtpServerType GetServerType() const { return SERVER_LSL; } | 55 virtual FtpServerType GetServerType() const { return SERVER_LS; } |
| 56 virtual bool ConsumeLine(const string16& line); | 56 virtual bool ConsumeLine(const string16& line); |
| 57 virtual bool EntryAvailable() const; | 57 virtual bool EntryAvailable() const; |
| 58 virtual FtpDirectoryListingEntry PopEntry(); | 58 virtual FtpDirectoryListingEntry PopEntry(); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 bool received_nonempty_line_; | 61 bool received_nonempty_line_; |
| 62 | 62 |
| 63 std::queue<FtpDirectoryListingEntry> entries_; | 63 std::queue<FtpDirectoryListingEntry> entries_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); | 65 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class FtpWindowsDirectoryListingParser : public FtpDirectoryListingParser { | 68 class FtpWindowsDirectoryListingParser : public FtpDirectoryListingParser { |
| 69 public: | 69 public: |
| 70 FtpWindowsDirectoryListingParser(); | 70 FtpWindowsDirectoryListingParser(); |
| 71 | 71 |
| 72 // FtpDirectoryListingParser methods: | 72 // FtpDirectoryListingParser methods: |
| 73 virtual FtpServerType GetServerType() const { return SERVER_DOS; } | 73 virtual FtpServerType GetServerType() const { return SERVER_WINDOWS; } |
| 74 virtual bool ConsumeLine(const string16& line); | 74 virtual bool ConsumeLine(const string16& line); |
| 75 virtual bool EntryAvailable() const; | 75 virtual bool EntryAvailable() const; |
| 76 virtual FtpDirectoryListingEntry PopEntry(); | 76 virtual FtpDirectoryListingEntry PopEntry(); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 std::queue<FtpDirectoryListingEntry> entries_; | 79 std::queue<FtpDirectoryListingEntry> entries_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(FtpWindowsDirectoryListingParser); | 81 DISALLOW_COPY_AND_ASSIGN(FtpWindowsDirectoryListingParser); |
| 82 }; | 82 }; |
| 83 | 83 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool last_is_directory_; | 122 bool last_is_directory_; |
| 123 | 123 |
| 124 std::queue<FtpDirectoryListingEntry> entries_; | 124 std::queue<FtpDirectoryListingEntry> entries_; |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser); | 126 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace net | 129 } // namespace net |
| 130 | 130 |
| 131 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ | 131 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ |
| OLD | NEW |