btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / net / HttpTime.h
blob7f622de8b377496008ab7ac30e4f95dc0cbb639f
1 /*
2 * Copyright 2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _B_HTTP_TIME_H_
6 #define _B_HTTP_TIME_H_
8 #include <ctime>
10 #include <DateTime.h>
11 #include <String.h>
13 namespace BPrivate {
15 enum {
16 B_HTTP_TIME_FORMAT_PARSED = -1,
17 B_HTTP_TIME_FORMAT_RFC1123 = 0,
18 B_HTTP_TIME_FORMAT_PREFERRED = B_HTTP_TIME_FORMAT_RFC1123,
19 B_HTTP_TIME_FORMAT_COOKIE,
20 B_HTTP_TIME_FORMAT_RFC1036,
21 B_HTTP_TIME_FORMAT_ASCTIME
25 class BHttpTime {
26 public:
27 BHttpTime();
28 BHttpTime(BDateTime date);
29 BHttpTime(const BString& dateString);
31 // Date modification
32 void SetString(const BString& string);
33 void SetDate(BDateTime date);
36 // Date conversion
37 BDateTime Parse();
38 BString ToString(int8 format = B_HTTP_TIME_FORMAT_PARSED);
40 private:
41 BString fDateString;
42 BDateTime fDate;
43 int8 fDateFormat;
47 #endif // _B_HTTP_TIME_H_