Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: net/ftp/ftp_directory_listing_parsers.h

Issue 374010: Implement Windows FTP directory listing parser. (Closed)
Patch Set: fixes Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 virtual FtpDirectoryListingEntry PopEntry(); 55 virtual FtpDirectoryListingEntry PopEntry();
56 56
57 private: 57 private:
58 bool received_nonempty_line_; 58 bool received_nonempty_line_;
59 59
60 std::queue<FtpDirectoryListingEntry> entries_; 60 std::queue<FtpDirectoryListingEntry> entries_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); 62 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser);
63 }; 63 };
64 64
65 class FtpWindowsDirectoryListingParser : public FtpDirectoryListingParser {
66 public:
67 FtpWindowsDirectoryListingParser();
68
69 // FtpDirectoryListingParser methods:
70 virtual bool ConsumeLine(const string16& line);
71 virtual bool EntryAvailable() const;
72 virtual FtpDirectoryListingEntry PopEntry();
73
74 private:
75 std::queue<FtpDirectoryListingEntry> entries_;
76
77 DISALLOW_COPY_AND_ASSIGN(FtpWindowsDirectoryListingParser);
78 };
79
65 // Parser for VMS-style directory listing (including variants). 80 // Parser for VMS-style directory listing (including variants).
66 class FtpVmsDirectoryListingParser : public FtpDirectoryListingParser { 81 class FtpVmsDirectoryListingParser : public FtpDirectoryListingParser {
67 public: 82 public:
68 FtpVmsDirectoryListingParser(); 83 FtpVmsDirectoryListingParser();
69 84
70 // FtpDirectoryListingParser methods: 85 // FtpDirectoryListingParser methods:
71 virtual bool ConsumeLine(const string16& line); 86 virtual bool ConsumeLine(const string16& line);
72 virtual bool EntryAvailable() const; 87 virtual bool EntryAvailable() const;
73 virtual FtpDirectoryListingEntry PopEntry(); 88 virtual FtpDirectoryListingEntry PopEntry();
74 89
(...skipping 27 matching lines...) Expand all
102 bool last_is_directory_; 117 bool last_is_directory_;
103 118
104 std::queue<FtpDirectoryListingEntry> entries_; 119 std::queue<FtpDirectoryListingEntry> entries_;
105 120
106 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser); 121 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser);
107 }; 122 };
108 123
109 } // namespace net 124 } // namespace net
110 125
111 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ 126 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_buffer_unittest.cc ('k') | net/ftp/ftp_directory_listing_parsers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698