本文整理汇总了C++中xbox::VString::AppendLong方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::AppendLong方法的具体用法?C++ VString::AppendLong怎么用?C++ VString::AppendLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::AppendLong方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendContextToBrowser
XBOX::VError VRemoteDebugPilot::SendContextToBrowser(
std::map< OpaqueDebuggerContext,VContextDescriptor* >::iterator& inCtxIt)
{
XBOX::VString resp;
XBOX::VString brkptsStr;
VChromeDebugHandler::GetJSONBreakpoints(brkptsStr);
resp = CVSTR("{\"method\":\"updateContext\",\"contextId\":\"");
resp.AppendLong8((sLONG8)(*inCtxIt).first);
resp += CVSTR("\",\"debugLineNb\":");
resp.AppendLong((*inCtxIt).second->fDebugInfos.fLineNb);
resp += CVSTR(",\"debugFileName\":\"");
resp += (*inCtxIt).second->fDebugInfos.fFileName;
resp += CVSTR("\",\"debugReason\":\"");
resp += (*inCtxIt).second->fDebugInfos.fReason;
resp += CVSTR("\",\"debugComment\":\"");
resp += (*inCtxIt).second->fDebugInfos.fComment;
resp += CVSTR("\",\"sourceLine\":\"");
resp += (*inCtxIt).second->fDebugInfos.fSourceLine;
resp += CVSTR("\",\"id\":\"");
resp += fClientId;
resp += "\",\"breakpoints\":";
resp += brkptsStr;
resp += CVSTR("}");
return SendToBrowser( resp );
}
示例2: MakeHostString
void MakeHostString (const XBOX::VString& inHost, PortNumber inPort, XBOX::VString& outHostString)
{
outHostString.Clear();
if (!inHost.IsEmpty())
outHostString.AppendString (inHost);
if (inPort != DEFAULT_LISTENING_PORT)
{
outHostString.AppendUniChar (CHAR_COLON);
outHostString.AppendLong (inPort);
}
}
示例3: ToString
XBOX::VString VHTTPCookie::ToString (bool inAlwaysExpires) const
{
XBOX::VString result;
if (!IsValid())
return result;
result.AppendString (fName);
result.AppendUniChar (CHAR_EQUALS_SIGN);
if (0 == fVersion)
{
// Netscape cookie
result.AppendString (fValue);
if (!fDomain.IsEmpty())
{
result.AppendCString ("; Domain=");
result.AppendString (fDomain);
}
if (!fPath.IsEmpty())
{
result.AppendCString ("; Path=");
result.AppendString (fPath);
}
if (fMaxAge >= 0)
{
XBOX::VTime curTime;
XBOX::VString timeString;
XBOX::VTime::Now (curTime);
curTime.AddSeconds (fMaxAge);
_GetRFC1123DateString (curTime, timeString);
result.AppendCString ("; Expires=");
result.AppendString (timeString);
}
if (fSecure)
{
result.AppendCString ("; Secure");
}
if (fHTTPOnly)
{
result.AppendCString ("; HttpOnly");
}
}
else
{
// RFC 2109 cookie
result.AppendString (fValue);
if (!fComment.IsEmpty())
{
result.AppendCString ("; Comment=\"");
result.AppendString (fComment);
result.AppendUniChar (CHAR_QUOTATION_MARK);
}
if (!fDomain.IsEmpty())
{
result.AppendCString ("; Domain=");
result.AppendString (fDomain);
}
if (!fPath.IsEmpty())
{
result.AppendCString ("; Path=");
result.AppendString (fPath);
}
else
{
result.AppendCString ("; Path=/");
}
if (fMaxAge >= 0)
{
result.AppendCString ("; Max-Age=");
result.AppendLong (fMaxAge);
/* For Internet Explorer 6, 7 & 8 which does not support 'max-age' */
if (inAlwaysExpires)
{
XBOX::VTime curTime;
XBOX::VString timeString;
XBOX::VTime::Now (curTime);
curTime.AddSeconds (fMaxAge);
_GetRFC1123DateString (curTime, timeString);
result.AppendCString ("; Expires=");
result.AppendString (timeString);
}
}
if (fSecure)
{
result.AppendCString ("; Secure");
//.........这里部分代码省略.........
示例4: SendResponse
//.........这里部分代码省略.........
uLONG bufferSize = (uLONG)GetBody().GetSize();
if (bufferSize <= cacheManager->GetCachedObjectMaxSize())
{
void * buffer = GetBody().GetDataPtr();
XBOX::VTime lastChecked;
VCachedObject * cachedObject = NULL;
XBOX::VTime::Now (lastChecked);
bool ok = cacheManager->AddPageToCache (fRequest->GetURL(),
virtualHost->GetUUIDString(),
contentType,
buffer,
bufferSize,
filePath,
lastChecked,
lastModified,
staticFile,
fCompressionMode,
&cachedObject);
if (ok)
{
if (NULL != cachedObject)
{
XBOX::VTime expirationDate;
sLONG maxAge = cachedObject->GetMaxAge();
if (maxAge > 0)
{
XBOX::VString string;
string.FromCString ("max-age=");
string.AppendLong (maxAge);
AddResponseHeader (STRING_HEADER_CACHE_CONTROL, string);
AddResponseHeader (STRING_HEADER_AGE, cachedObject->GetAge());
if (cachedObject->GetExpirationDate (expirationDate))
AddResponseHeader (STRING_HEADER_EXPIRES, expirationDate);
}
else if (cachedObject->GetExpirationDate (expirationDate) && IsVTimeValid (expirationDate))
{
AddResponseHeader (STRING_HEADER_EXPIRES, expirationDate);
}
XBOX::QuickReleaseRefCountable (cachedObject);
}
}
}
}
if (!lastModifiedString.IsEmpty())
AddResponseHeader (STRING_HEADER_LAST_MODIFIED, lastModifiedString);
}
if (HTTP_OK == fResponseStatusCode)
{
if (NULL != fFileToSend)
{
if (fFileToSend->Exists())
{
sLONG8 fileSize = 0;
fFileToSend->GetSize (&fileSize);
this->SetContentLengthHeader (fileSize); // YT 18-Jul-2011 - ACI0072287
if (XBOX::VE_OK == (error = _SendResponseHeader()))