45939109b4
Integrated the classes in the Network Kit (libbnetapi.so). Only the foundation classed BUrl, BUrlContext, BNetworkCookie, BNetworkCookieJar and the private HttpTime code is currently compiled. The BUrlProtocol currently contains some misplaced BUrlProtocolHttp specific stuff, and the HTTP stuff itself has a dependency on libcrypto and should live in an add-on instead. I've sprinkled some TODOs in the code, and I've done some renaming compared to the last version of the GSoC patch. Any help to bring this further along is appreciated. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39161 a95241bf-73f2-0310-859d-f6bbb57e9c96
47 lines
877 B
C++
47 lines
877 B
C++
/*
|
|
* Copyright 2010 Haiku Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _B_HTTP_TIME_H_
|
|
#define _B_HTTP_TIME_H_
|
|
|
|
#include <ctime>
|
|
|
|
#include <String.h>
|
|
|
|
namespace BPrivate {
|
|
|
|
enum {
|
|
B_HTTP_TIME_FORMAT_PARSED = -1,
|
|
B_HTTP_TIME_FORMAT_RFC1123 = 0,
|
|
B_HTTP_TIME_FORMAT_PREFERRED = B_HTTP_TIME_FORMAT_RFC1123,
|
|
B_HTTP_TIME_FORMAT_COOKIE,
|
|
B_HTTP_TIME_FORMAT_RFC1036,
|
|
B_HTTP_TIME_FORMAT_ASCTIME
|
|
};
|
|
|
|
|
|
class BHttpTime {
|
|
public:
|
|
BHttpTime();
|
|
BHttpTime(time_t date);
|
|
BHttpTime(const BString& dateString);
|
|
|
|
// Date modification
|
|
void SetString(const BString& string);
|
|
void SetDate(time_t date);
|
|
|
|
|
|
// Date conversion
|
|
time_t Parse();
|
|
BString ToString(int8 format = B_HTTP_TIME_FORMAT_PARSED);
|
|
|
|
private:
|
|
BString fDateString;
|
|
time_t fDate;
|
|
int8 fDateFormat;
|
|
};
|
|
|
|
}
|
|
#endif // _B_HTTP_TIME_H_
|