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

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

Issue 384007: Distinguish between old and new FTP LIST response parsers (Closed)
Patch Set: eroman's suggestion 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
« no previous file with comments | « no previous file | net/ftp/ftp_server_type_histograms.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/ftp/ftp_server_type_histograms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698