Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / ftp / ftp_directory_listing_parser.h
blobd2dd677bb09e6e78a4a96f642eb2ab07a88b6a49
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/strings/string16.h"
13 #include "base/time/time.h"
14 #include "net/base/net_export.h"
16 namespace net {
18 struct FtpDirectoryListingEntry {
19 enum Type {
20 UNKNOWN,
21 FILE,
22 DIRECTORY,
23 SYMLINK,
26 FtpDirectoryListingEntry();
28 Type type;
29 base::string16 name; // Name (UTF-16-encoded).
30 std::string raw_name; // Name in original character encoding.
31 int64 size; // File size, in bytes. -1 if not applicable.
33 // Last modified time, in local time zone.
34 base::Time last_modified;
37 // Parses an FTP directory listing |text|. On success fills in |entries|.
38 // Returns network error code.
39 NET_EXPORT int ParseFtpDirectoryListing(
40 const std::string& text,
41 const base::Time& current_time,
42 std::vector<FtpDirectoryListingEntry>* entries);
44 } // namespace net
46 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_