| 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" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "net/ftp/ftp_server_type_histograms.h" | 13 #include "net/ftp/ftp_server_type_histograms.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 struct FtpDirectoryListingEntry { | 17 struct FtpDirectoryListingEntry { |
| 18 enum Type { | 18 enum Type { |
| 19 FILE, | 19 FILE, |
| 20 DIRECTORY, | 20 DIRECTORY, |
| 21 SYMLINK, | 21 SYMLINK, |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 Type type; | 24 Type type; |
| 25 string16 name; | 25 string16 name; |
| 26 int64 size; // File size, in bytes. -1 if not applicable. |
| 26 | 27 |
| 27 // Last modified time, in local time zone. | 28 // Last modified time, in local time zone. |
| 28 base::Time last_modified; | 29 base::Time last_modified; |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 class FtpDirectoryListingParser { | 32 class FtpDirectoryListingParser { |
| 32 public: | 33 public: |
| 33 virtual ~FtpDirectoryListingParser(); | 34 virtual ~FtpDirectoryListingParser(); |
| 34 | 35 |
| 35 // Adds |line| to the internal parsing buffer. Returns true on success. | 36 // Adds |line| to the internal parsing buffer. Returns true on success. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 std::queue<FtpDirectoryListingEntry> entries_; | 57 std::queue<FtpDirectoryListingEntry> entries_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); | 59 DISALLOW_COPY_AND_ASSIGN(FtpLsDirectoryListingParser); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace net | 62 } // namespace net |
| 62 | 63 |
| 63 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ | 64 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSERS_H_ |
| OLD | NEW |