本文整理汇总了C++中xbox::VString::FromLong8方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::FromLong8方法的具体用法?C++ VString::FromLong8怎么用?C++ VString::FromLong8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::FromLong8方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _NormalizeResponseHeader
bool VHTTPResponse::_NormalizeResponseHeader()
{
/*
HTTP automatic fixes: (to mimic Apache's behavior for CGIs (m.c)
*/
XBOX::VString fieldValue;
// Special CGI case: the cgi author can use the Status field to set the response code
if (GetHeaders().IsHeaderSet (STRING_HEADER_STATUS))
{
if (GetHeaders().GetHeaderValue (STRING_HEADER_STATUS, fieldValue))
{
SetResponseStatusCode ((HTTPStatusCode)HTTPServerTools::GetLongFromString (fieldValue));
GetHeaders().RemoveHeader (STRING_HEADER_STATUS);
}
}
// We still support some legacy, non standard special token:
if (GetHeaders().IsHeaderSet (STRING_HEADER_X_STATUS))
{
if (GetHeaders().GetHeaderValue (STRING_HEADER_X_STATUS, fieldValue))
{
SetResponseStatusCode ((HTTPStatusCode)HTTPServerTools::GetLongFromString (fieldValue));
GetHeaders().RemoveHeader (STRING_HEADER_X_STATUS);
}
}
if (GetHeaders().IsHeaderSet (STRING_HEADER_X_VERSION))
{
if (GetHeaders().GetHeaderValue (STRING_HEADER_X_VERSION, fieldValue))
{
if (HTTPServerTools::EqualASCIICString (fieldValue, "http/1.0"))
SetHTTPVersion (VERSION_1_0);
else
SetHTTPVersion (VERSION_1_1);
GetHeaders().RemoveHeader (STRING_HEADER_X_VERSION);
}
}
// Classic Redirect trick
if (GetHeaders().IsHeaderSet (STRING_HEADER_LOCATION) && (((sLONG)fResponseStatusCode / 100) != 3))
SetResponseStatusCode (HTTP_FOUND);
// Best practice see: http://developer.yahoo.com/performance/rules.html#expires
/*
if (fCanCacheBody && fResponseStatusCode == 200 && !GetHeaders().IsHeaderSet (STRING_HEADER_EXPIRES))
{
HTTPProtocol::MakeRFC822GMTDateString (GMT_FAR_FUTURE, fieldValue);
GetHeaders().SetHeaderValue (STRING_HEADER_EXPIRES, fieldValue);
}
*/
if (!GetHeaders().IsHeaderSet (STRING_HEADER_CONTENT_LENGTH) && GetBody().GetDataSize())
{
fieldValue.FromLong8 (GetBody().GetDataSize());
GetHeaders().SetHeaderValue (STRING_HEADER_CONTENT_LENGTH, fieldValue);
}
if (!GetHeaders().IsHeaderSet (STRING_HEADER_CONTENT_TYPE) && GetBody().GetDataSize())
GetHeaders().SetHeaderValue (STRING_HEADER_CONTENT_TYPE, STRING_CONTENT_TYPE_BINARY);
return true;
}
示例2: SetContentLengthHeader
bool VHTTPResponse::SetContentLengthHeader (const sLONG8 inValue)
{
XBOX::VString string;
string.FromLong8 (inValue);
return GetHeaders().SetHeaderValue (STRING_HEADER_CONTENT_LENGTH, string, true);
}