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

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

Issue 368006: Fix the "ls -l" FTP LIST format parser to understand correctly (Closed)
Patch Set: make the code more obvious 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class FtpLsDirectoryListingParser : public FtpDirectoryListingParser { 48 class FtpLsDirectoryListingParser : public FtpDirectoryListingParser {
49 public: 49 public:
50 FtpLsDirectoryListingParser(); 50 FtpLsDirectoryListingParser();
51 51
52 // FtpDirectoryListingParser methods: 52 // FtpDirectoryListingParser methods:
53 virtual bool ConsumeLine(const string16& line); 53 virtual bool ConsumeLine(const string16& line);
54 virtual bool EntryAvailable() const; 54 virtual bool EntryAvailable() const;
55 virtual FtpDirectoryListingEntry PopEntry(); 55 virtual FtpDirectoryListingEntry PopEntry();
56 56
57 private: 57 private:
58 bool received_nonempty_line_;
59
58 std::queue<FtpDirectoryListingEntry> entries_; 60 std::queue<FtpDirectoryListingEntry> entries_;
59 61
60 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); 62 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser);
61 }; 63 };
62 64
63 // Parser for VMS-style directory listing (including variants). 65 // Parser for VMS-style directory listing (including variants).
64 class FtpVmsDirectoryListingParser : public FtpDirectoryListingParser { 66 class FtpVmsDirectoryListingParser : public FtpDirectoryListingParser {
65 public: 67 public:
66 FtpVmsDirectoryListingParser(); 68 FtpVmsDirectoryListingParser();
67 69
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 bool last_is_directory_; 102 bool last_is_directory_;
101 103
102 std::queue<FtpDirectoryListingEntry> entries_; 104 std::queue<FtpDirectoryListingEntry> entries_;
103 105
104 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser); 106 DISALLOW_COPY_AND_ASSIGN(FtpVmsDirectoryListingParser);
105 }; 107 };
106 108
107 } // namespace net 109 } // namespace net
108 110
109 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ 111 #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