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

Unified Diff: net/ftp/ftp_directory_listing_parser_ls.h

Issue 465035: Split FTP LIST parsing code into individual files for each listing style. (Closed)
Patch Set: fix Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ftp/ftp_directory_listing_parser.cc ('k') | net/ftp/ftp_directory_listing_parser_ls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_parser_ls.h
diff --git a/net/ftp/ftp_directory_listing_parser_ls.h b/net/ftp/ftp_directory_listing_parser_ls.h
new file mode 100644
index 0000000000000000000000000000000000000000..689fb7e613058589a5f0d57dcc568c23152fa40d
--- /dev/null
+++ b/net/ftp/ftp_directory_listing_parser_ls.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_LS_H_
+#define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_LS_H_
+
+#include <queue>
+
+#include "net/ftp/ftp_directory_listing_parser.h"
+
+namespace net {
+
+// Parser for "ls -l"-style directory listing.
+class FtpDirectoryListingParserLs : public FtpDirectoryListingParser {
+ public:
+ FtpDirectoryListingParserLs();
+
+ // FtpDirectoryListingParser methods:
+ virtual FtpServerType GetServerType() const { return SERVER_LS; }
+ virtual bool ConsumeLine(const string16& line);
+ virtual bool OnEndOfInput();
+ virtual bool EntryAvailable() const;
+ virtual FtpDirectoryListingEntry PopEntry();
+
+ private:
+ bool received_nonempty_line_;
+
+ std::queue<FtpDirectoryListingEntry> entries_;
+
+ DISALLOW_COPY_AND_ASSIGN(FtpDirectoryListingParserLs);
+};
+
+} // namespace net
+
+#endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_LS_H_
« no previous file with comments | « net/ftp/ftp_directory_listing_parser.cc ('k') | net/ftp/ftp_directory_listing_parser_ls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698