--- parser3/src/include/pa_common.h 2009/04/22 04:35:31 1.129 +++ parser3/src/include/pa_common.h 2009/09/03 11:08:28 1.136 @@ -1,14 +1,14 @@ /** @file Parser: commonly used functions. - Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_COMMON_H #define PA_COMMON_H -static const char * const IDENT_COMMON_H="$Date: 2009/04/22 04:35:31 $"; +static const char * const IDENT_COMMON_H="$Date: 2009/09/03 11:08:28 $"; #include "pa_string.h" #include "pa_hash.h" @@ -16,18 +16,43 @@ static const char * const IDENT_COMMON_H class Request; // defines -#define HTTP_USER_AGENT_UPPER "USER-AGENT" +#define HTTP_USER_AGENT "user-agent" +#define HTTP_STATUS "status" +#define HTTP_CONTENT_LENGTH "content-length" + +#define HTTP_CONTENT_TYPE "content-type" #define HTTP_CONTENT_TYPE_UPPER "CONTENT-TYPE" -#define HTTP_USER_AGENT "User-Agent" -#define HTTP_CONTENT_TYPE "Content-Type" -#define HTTP_CONTENT_DISPOSITION "Content-Disposition" #define HTTP_CONTENT_TYPE_FORM_URLENCODED "application/x-www-form-urlencoded" #define HTTP_CONTENT_TYPE_MULTIPART_FORMDATA "multipart/form-data" #define HTTP_CONTENT_TYPE_MULTIPART_RELATED "multipart/related" #define HTTP_CONTENT_TYPE_MULTIPART_MIXED "multipart/mixed" +#define CONTENT_TRANSFER_ENCODING_NAME "content-transfer-tncoding" + +#define CONTENT_DISPOSITION "content-disposition" +#define CONTENT_DISPOSITION_ATTACHMENT "attachment" +#define CONTENT_DISPOSITION_INLINE "inline" +#define CONTENT_DISPOSITION_FILENAME_NAME "filename" + +const String http_content_type(HTTP_CONTENT_TYPE); + +const String content_transfer_encoding_name(CONTENT_TRANSFER_ENCODING_NAME); + +const String content_disposition(CONTENT_DISPOSITION); +const String content_disposition_inline(CONTENT_DISPOSITION_INLINE); +const String content_disposition_attachment(CONTENT_DISPOSITION_ATTACHMENT); +const String content_disposition_filename_name(CONTENT_DISPOSITION_FILENAME_NAME); + + +#define HASH_ORDER + +#ifdef HASH_ORDER +#undef PA_HASH_CLASS +#include "pa_hash.h" +#endif + class Value; -typedef Hash HashStringValue; +typedef HASH_STRING HashStringValue; // replace system s*nprintf with our versions #undef vsnprintf @@ -69,6 +94,8 @@ inline long lseek( int handle, long offs #endif +const char* capitalize(const char* s); + /** under WIN32 "t" mode fixes DOS chars OK, can't say that about other systems/ line break styles */ @@ -231,7 +258,6 @@ bool StrStartFromNC(const char* str, con size_t strpos(const char *str, const char *substr); Charset* detect_charset(const char* content_type); -Charset* detect_charset(Charset& source_charset, const String& content_type); #define SECS_PER_DAY (60*60*24) int getMonthDays(int year, int month);