本文整理汇总了C++中xbox::VString::GetSubString方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::GetSubString方法的具体用法?C++ VString::GetSubString怎么用?C++ VString::GetSubString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::GetSubString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseHostString
void ParseHostString (const XBOX::VString& inHostString, XBOX::VString& outIPv4String, PortNumber& outPort)
{
XBOX::VIndex pos = inHostString.FindUniChar (CHAR_COLON);
if (pos > 0)
{
XBOX::VString portString;
inHostString.GetSubString (1, pos - 1, outIPv4String);
inHostString.GetSubString (pos + 1, inHostString.GetLength() - pos, portString);
outPort = portString.GetLong();
}
else
{
outIPv4String.FromString (inHostString);
outPort = DEFAULT_LISTENING_PORT;
}
}
示例2: _RemoveProjectPatternFromURL
static
bool _RemoveProjectPatternFromURL (const XBOX::VString& inProjectPattern, XBOX::VString& ioURL)
{
if (inProjectPattern.IsEmpty())
return false;
XBOX::VString url (ioURL);
sLONG pos = HTTPServerTools::FindASCIIVString (url, inProjectPattern);
if (pos == 2) // Takes the starting CHAR_SOLIDUS into account
{
url.GetSubString (pos + inProjectPattern.GetLength(), url.GetLength() - inProjectPattern.GetLength() - 1, ioURL);
return true;
}
return false;;
}
示例3: _WriteWLF_ELF
//.........这里部分代码省略.........
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
break;
case LOG_TOKEN_SEARCH_ARGS: // The search arguments to the URL (text after a question mark)
string.FromString (inHTTPResponse.GetRequest().GetURLQuery());
fRequestsBuffer.AppendString (string);
break;
case LOG_TOKEN_ELF_CS_URI_QUERY: // Search argument portion of the HTTP request. "first=last&last=first"
string.FromString (inHTTPResponse.GetRequest().GetURLQuery());
if (!string.IsEmpty())
fRequestsBuffer.AppendString (string);
else
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
break;
case LOG_TOKEN_CONNECTION_ID: // A number that is unique for each connection for this invocation of the server. Typically socket number.
{
sLONG rawSocket = inHTTPResponse.GetRawSocket();
if (rawSocket > 0)
{
fRequestsBuffer.AppendLong (rawSocket);
}
else
{
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
}
break;
}
case LOG_TOKEN_ELF_CS_COOKIE: // The "cookie" information sent in this request "Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 20-Jan-05 23:12:40 GMT"
string.Clear();
inHTTPResponse.GetRequest().GetHTTPHeaders().GetHeaderValue (STRING_HEADER_COOKIE, string);
fRequestsBuffer.AppendUniChar (CHAR_QUOTATION_MARK);
fRequestsBuffer.AppendString (string);
fRequestsBuffer.AppendUniChar (CHAR_QUOTATION_MARK);
break;
case LOG_TOKEN_TRANSFER_TIME: // Time-Taken in millisecond like IIS
{
uLONG timeTaken = (XBOX::VSystem::GetCurrentTime() - inHTTPResponse.GetStartRequestTime());
fRequestsBuffer.AppendLong (timeTaken);
break;
}
case LOG_TOKEN_WLF_BYTES_RECEIVED:
{
sLONG8 bytesReceived = inHTTPResponse.GetRequest().GetRequestBody().GetDataSize();
if (bytesReceived > 0)
{
fRequestsBuffer.AppendLong8 (bytesReceived);
}
else
{
fRequestsBuffer.AppendUniChar (CHAR_DIGIT_ZERO);
}
break;
}
case LOG_TOKEN_PATH_ARGS: //The path arguments to the URL for a CGI (the text after a dollar sign)
{
sLONG posChar = 0;
XBOX::VString pathArgString;
string.FromString (inHTTPResponse.GetRequest().GetURL());
if (!string.IsEmpty() && (posChar = string.FindUniChar (CHAR_DOLLAR_SIGN)) > 0)
{
// Let's delete all the stuff before '$'
string.GetSubString (posChar + 1, string.GetLength() - posChar, pathArgString);
// We delete the query arguments after the ? : we only want the string after the '$'
if ((posChar = pathArgString.FindUniChar (CHAR_QUESTION_MARK)) > 0)
pathArgString.SubString (1, posChar - 1);
}
if (!pathArgString.IsEmpty())
{
fRequestsBuffer.AppendString (pathArgString);
}
else
{
fRequestsBuffer.AppendUniChar (CHAR_HYPHEN_MINUS);
}
break;
}
default: // this should never happen.
assert (false);
fRequestsBuffer.AppendCString ("UNKNOWN_FIELD");
break;
}
VectorOfLogToken::const_iterator nextToken = it;
if (++nextToken != tokens.end())
fRequestsBuffer.AppendUniChar (CHAR_SPACE);
}
fRequestsBuffer.AppendUniChar (HTTP_LF);
return XBOX::VE_OK;
}