Patch done by Christophe Huriaux as part of GSoC 2010 "Services Kit" project:

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
This commit is contained in:
Stephan Aßmus
2010-10-27 14:03:31 +00:00
parent 1294543de9
commit 45939109b4
34 changed files with 7746 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
/*
* 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_