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

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

Issue 1120012: Fix the "ls -l" style date parser to correctly guess the year if it is not provided. (Closed)
Patch Set: better comments Created 10 years, 9 months 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 | « net/ftp/ftp_directory_listing_parser_netware_unittest.cc ('k') | net/ftp/ftp_util.cc » ('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. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_FTP_FTP_UTIL_H_ 5 #ifndef NET_FTP_FTP_UTIL_H_
6 #define NET_FTP_FTP_UTIL_H_ 6 #define NET_FTP_FTP_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // Convert VMS path to Unix-style path. 26 // Convert VMS path to Unix-style path.
27 static std::string VMSPathToUnix(const std::string& vms_path); 27 static std::string VMSPathToUnix(const std::string& vms_path);
28 28
29 // Convert three-letter month abbreviation (like Nov) to its number (in range 29 // Convert three-letter month abbreviation (like Nov) to its number (in range
30 // 1-12). 30 // 1-12).
31 static bool ThreeLetterMonthToNumber(const string16& text, int* number); 31 static bool ThreeLetterMonthToNumber(const string16& text, int* number);
32 32
33 // Convert a "ls -l" date listing to time. The listing comes in three columns. 33 // Convert a "ls -l" date listing to time. The listing comes in three columns.
34 // The first one contains month, the second one contains day of month. 34 // The first one contains month, the second one contains day of month.
35 // The first one is either a time (and then the current year is assumed), 35 // The first one is either a time (and then we guess the year based
36 // or is a year (and then we don't know the time). 36 // on |current_time|), or is a year (and then we don't know the time).
37 static bool LsDateListingToTime(const string16& month, 37 static bool LsDateListingToTime(const string16& month,
38 const string16& day, 38 const string16& day,
39 const string16& rest, 39 const string16& rest,
40 base::Time* time); 40 const base::Time& current_time,
41 base::Time* result);
41 42
42 // Skip |columns| columns from |text| (whitespace-delimited), and return the 43 // Skip |columns| columns from |text| (whitespace-delimited), and return the
43 // remaining part, without leading/trailing whitespace. 44 // remaining part, without leading/trailing whitespace.
44 static string16 GetStringPartAfterColumns(const string16& text, int columns); 45 static string16 GetStringPartAfterColumns(const string16& text, int columns);
45 }; 46 };
46 47
47 } // namespace net 48 } // namespace net
48 49
49 #endif // NET_FTP_FTP_UTIL_H_ 50 #endif // NET_FTP_FTP_UTIL_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_netware_unittest.cc ('k') | net/ftp/ftp_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698