本文整理汇总了C++中xbox::VString::Exchange方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::Exchange方法的具体用法?C++ VString::Exchange怎么用?C++ VString::Exchange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::Exchange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToXMLCompatibleText
void ToXMLCompatibleText(const XBOX::VString& inText, XBOX::VString& outText)
{
outText = inText;
sLONG len = inText.GetLength();
outText.Exchange( CVSTR("&"), CVSTR("&"), 1, len);
len = outText.GetLength();
outText.Exchange( CVSTR("<"), CVSTR("<"), 1, len);
len = outText.GetLength();
outText.Exchange( CVSTR(">"), CVSTR(">"), 1, len);
outText.ConvertCarriageReturns(XBOX::eCRM_CR);
len = outText.GetLength();
outText.Exchange( CVSTR("\r"), CVSTR("<BR/>"), 1, len);
len = outText.GetLength();
outText.Exchange( CVSTR("\13"), CVSTR("<BR/>"), 1, len);//[MI] le 28/12/2010 ACI0069253
}
示例2: _WriteWLF_ELF
XBOX::VError VHTTPServerLog::_WriteWLF_ELF (const IHTTPResponse& inHTTPResponse)
{
XBOX::VString string;
XBOX::VString ipAddress;
const VectorOfLogToken tokens = fSettings.GetLogTokens();
const EHTTPServerLogFormat format = fSettings.GetLogFormat();
for (VectorOfLogToken::const_iterator it = tokens.begin(); it != tokens.end(); ++it)
{
switch (*it)
{
case LOG_TOKEN_DATE:
string.Clear();
if (format == LOG_FORMAT_ELF)
{
_GetCurrentFormatedDate (string, false);
}
else
{
_GetCurrentFormatedDate (string, true, HTTP_SOLIDUS);
}
if (!string.IsEmpty())
{
fRequestsBuffer.AppendString (string);
}
else
{
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
}
break;
case LOG_TOKEN_TIME:
string.Clear();
if (format == LOG_FORMAT_WLF)
_GetCurrentFormatedTime (string, true);
else
_GetCurrentFormatedTime (string, false);
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_STATUS:
string.FromLong ((sLONG)inHTTPResponse.GetResponseStatusCode());
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_ELF_S_IP:
string.Clear();
HTTPServerTools::MakeIPv4String (inHTTPResponse.GetIPv4(), string);
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_HOST_NAME: // = C_DNS .....
case LOG_TOKEN_ELF_C_DNS: // DNS lookup : tres couteux en perf : remplacé par l'IP du client (les analyseurs de log font le DNS lookup)...
case LOG_TOKEN_ELF_C_IP: // Client IP Address 192.0.1.3
string.Clear();
HTTPServerTools::MakeIPv4String (inHTTPResponse.GetIPv4(), string);
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_METHOD: // The HTTP method : GET HEAD POST. If Unknown, we just copy it
string.Clear();
HTTPProtocol::MakeHTTPMethodString (inHTTPResponse.GetRequest().GetRequestMethod(), string);
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_BYTES_SENT: //WLF : Bytes sent to the client : = HTTP Content Length
string.Clear();
if (inHTTPResponse.GetResponseHeader (STRING_HEADER_CONTENT_LENGTH, string) && !string.IsEmpty())
fRequestsBuffer.AppendString (string);
else
fRequestsBuffer.AppendUniChar (CHAR_DIGIT_ZERO);
break;
case LOG_TOKEN_AGENT: // The identity of the browser software or other client. Mozilla/4.04_(Macintosh;_U;_PPC)
string.Clear();
if (inHTTPResponse.GetRequest().GetHTTPHeaders().GetHeaderValue (STRING_HEADER_USER_AGENT, string) && !string.IsEmpty())
{
string.Exchange (CHAR_SPACE, CHAR_LOW_LINE);
fRequestsBuffer.AppendString (string);
}
else
{
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
}
break;
case LOG_TOKEN_CS_USER_AGENT: // HTTP request's "User-Agent" header field. "Mozilla/4.04 (Macintosh; U; PPC)"
string.Clear();
inHTTPResponse.GetRequest().GetHTTPHeaders().GetHeaderValue (STRING_HEADER_USER_AGENT, string);
fRequestsBuffer.AppendUniChar (CHAR_QUOTATION_MARK);
fRequestsBuffer.AppendString (string);
fRequestsBuffer.AppendUniChar (CHAR_QUOTATION_MARK);
break;
case LOG_TOKEN_USER: //The User Name if there was a Web User entry for a realm.
string.Clear();
inHTTPResponse.GetRequest().GetAuthenticationInfos()->GetUserName (string);
_WriteUsername (string, fRequestsBuffer);
break;
//.........这里部分代码省略.........