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

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

Issue 6697021: FTP: use ICU to parse month abbreviations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unneeded header Created 9 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 | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 12
13 namespace base { 13 namespace base {
14 class Time; 14 class Time;
15 } 15 }
16 16
17 namespace net { 17 namespace net {
18 18
19 class FtpUtil { 19 class FtpUtil {
20 public: 20 public:
21 // Convert Unix file path to VMS path (must be a file, and not a directory). 21 // Convert Unix file path to VMS path (must be a file, and not a directory).
22 static std::string UnixFilePathToVMS(const std::string& unix_path); 22 static std::string UnixFilePathToVMS(const std::string& unix_path);
23 23
24 // Convert Unix directory path to VMS path (must be a directory). 24 // Convert Unix directory path to VMS path (must be a directory).
25 static std::string UnixDirectoryPathToVMS(const std::string& unix_path); 25 static std::string UnixDirectoryPathToVMS(const std::string& unix_path);
26 26
27 // Convert VMS path to Unix-style path. 27 // Convert VMS path to Unix-style path.
28 static std::string VMSPathToUnix(const std::string& vms_path); 28 static std::string VMSPathToUnix(const std::string& vms_path);
29 29
30 // Convert three-letter month abbreviation (like Nov) to its number (in range 30 // Convert abbreviated month (like Nov) to its number (in range 1-12).
eroman 2011/03/16 00:46:45 nit: We should be using tense like "Converts" for
Paweł Hajdan Jr. 2011/03/16 20:17:28 Done.
31 // 1-12). 31 // Note: in some locales abbreviations are more than three letters long,
32 static bool ThreeLetterMonthToNumber(const string16& text, int* number); 32 // and this function also handles them correctly.
33 static bool AbbreviatedMonthToNumber(const string16& text, int* number);
33 34
34 // Convert a "ls -l" date listing to time. The listing comes in three columns. 35 // Convert a "ls -l" date listing to time. The listing comes in three columns.
35 // The first one contains month, the second one contains day of month. 36 // The first one contains month, the second one contains day of month.
36 // The first one is either a time (and then we guess the year based 37 // The first one is either a time (and then we guess the year based
37 // on |current_time|), or is a year (and then we don't know the time). 38 // on |current_time|), or is a year (and then we don't know the time).
38 static bool LsDateListingToTime(const string16& month, 39 static bool LsDateListingToTime(const string16& month,
39 const string16& day, 40 const string16& day,
40 const string16& rest, 41 const string16& rest,
41 const base::Time& current_time, 42 const base::Time& current_time,
42 base::Time* result); 43 base::Time* result);
43 44
44 // Skip |columns| columns from |text| (whitespace-delimited), and return the 45 // Skip |columns| columns from |text| (whitespace-delimited), and return the
45 // remaining part, without leading/trailing whitespace. 46 // remaining part, without leading/trailing whitespace.
46 static string16 GetStringPartAfterColumns(const string16& text, int columns); 47 static string16 GetStringPartAfterColumns(const string16& text, int columns);
47 }; 48 };
48 49
49 } // namespace net 50 } // namespace net
50 51
51 #endif // NET_FTP_FTP_UTIL_H_ 52 #endif // NET_FTP_FTP_UTIL_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/ftp/ftp_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698