本文整理汇总了C++中xbox::VString::GetLong方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::GetLong方法的具体用法?C++ VString::GetLong怎么用?C++ VString::GetLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::GetLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: FromString
void VHTTPCookie::FromString (const XBOX::VString& inString)
{
XBOX::VectorOfVString stringValues;
XBOX::VString string;
XBOX::VString nameString;
XBOX::VString valueString;
Clear();
inString.GetSubStrings (CHAR_SEMICOLON, stringValues, false, true);
for (VectorOfVString::iterator it = stringValues.begin(); it != stringValues.end(); ++it)
{
sLONG pos = 0;
string.FromString (*it);
if ((pos = HTTPTools::FindASCIICString (string, "secure")) == 1)
{
SetSecure (true);
}
else if ((pos = HTTPTools::FindASCIICString (string, "httpOnly")) == 1)
{
SetHttpOnly (true);
}
else if ((pos = HTTPTools::FindASCIICString (string, "version")) == 1)
{
SetVersion (1);
}
else if ((pos = HTTPTools::FindASCIICString (string, "max-age")) == 1)
{
HTTPTools::ExtractFieldNameValue (string, nameString, valueString);
fMaxAge = valueString.GetLong();
}
else if ((pos = HTTPTools::FindASCIICString (string, "expires")) == 1)
{
XBOX::VTime curTime;
XBOX::VTime expiresTime;
XBOX::VTime::Now (curTime);
HTTPTools::ExtractFieldNameValue (string, nameString, valueString);
expiresTime.FromRfc822String (valueString);
if (expiresTime.GetMilliseconds() > curTime.GetMilliseconds())
fMaxAge = (expiresTime.GetMilliseconds() - curTime.GetMilliseconds()) / 1000;
}
else if ((pos = HTTPTools::FindASCIICString (string, "path")) == 1)
{
HTTPTools::ExtractFieldNameValue (string, nameString, fPath);
}
else if ((pos = HTTPTools::FindASCIICString (string, "domain")) == 1)
{
HTTPTools::ExtractFieldNameValue (string, nameString, fDomain);
}
else if ((pos = HTTPTools::FindASCIICString (string, "comment")) == 1)
{
HTTPTools::ExtractFieldNameValue (string, nameString, fComment);
}
else if ((pos = HTTPTools::FindASCIICString (string, "=")))
{
HTTPTools::ExtractFieldNameValue (string, fName, fValue);
}
}
}