summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_util.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 19:51:46 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-07 19:51:46 +0000
commit8425e66e2202fa2f226a5077618219cf307792f5 (patch)
tree4bcf13f19e21228c5ee771b327261d0e874cf80a /net/ftp/ftp_util.h
parent6f17bdfe86a739074d44cefb9256001585036ce1 (diff)
downloadchromium_src-8425e66e2202fa2f226a5077618219cf307792f5.zip
chromium_src-8425e66e2202fa2f226a5077618219cf307792f5.tar.gz
chromium_src-8425e66e2202fa2f226a5077618219cf307792f5.tar.bz2
Implement parser for Netware-style FTP LIST response listing.
TEST=Covered by net_unittests. BUG=25520 Review URL: http://codereview.chromium.org/465059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_util.h')
-rw-r--r--net/ftp/ftp_util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/ftp/ftp_util.h b/net/ftp/ftp_util.h
index 2a73c68..518801b 100644
--- a/net/ftp/ftp_util.h
+++ b/net/ftp/ftp_util.h
@@ -9,6 +9,10 @@
#include "base/string16.h"
+namespace base {
+class Time;
+}
+
namespace net {
class FtpUtil {
@@ -25,6 +29,15 @@ class FtpUtil {
// Convert three-letter month abbreviation (like Nov) to its number (in range
// 1-12).
static bool ThreeLetterMonthToNumber(const string16& text, int* number);
+
+ // Convert a "ls -l" date listing to time. The listing comes in three columns.
+ // The first one contains month, the second one contains day of month.
+ // The first one is either a time (and then the current year is assumed),
+ // or is a year (and then we don't know the time).
+ static bool LsDateListingToTime(const string16& month,
+ const string16& day,
+ const string16& rest,
+ base::Time* time);
};
} // namespace net