本文整理汇总了C++中VString::EqualToString方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::EqualToString方法的具体用法?C++ VString::EqualToString怎么用?C++ VString::EqualToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VString
的用法示例。
在下文中一共展示了VString::EqualToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ModuleConstructor
XBOX::VJSObject VJSTLSClass::_ModuleConstructor (const VJSContext &inContext, const VString &inModuleName)
{
xbox_assert(inModuleName.EqualToString(kModuleName, true));
VJSTLSClass::Class();
return VJSTLSClass::CreateInstance(inContext, NULL);
}
示例2: EndElement
void VSpanHandler::EndElement( const VString& inElementName)
{
xbox_assert(inElementName == fElementName);
VTextStyle *style = fStyles->GetData();
if (style)
{
sLONG vbegin, vend;
style->GetRange(vbegin,vend);
vend = fText->GetLength();
style->SetRange(vbegin,vend);
}
if (!fParseSpanOnly)
{
//HTML parsing:
if (inElementName.EqualToString("q"))
//end of quote
*fText += "\"";
//add break lines for elements which need it
if (VTaggedTextSAXHandler::NeedBreakLine(inElementName))
*fText += "\r";
}
}
示例3: SetHTMLAttribute
void VSpanHandler::SetHTMLAttribute(const VString& inName, const VString& inValue)
{
//here we need to parse only mandatory font attributes
if (inName.EqualToString("face"))
SetFont(inValue);
else if (inName.EqualToString("color"))
SetColor( inValue);
else if (inName.EqualToString("bgcolor"))
SetBackgroundColor( inValue);
else if (inName.EqualToString("size"))
{
//HTML font size is a number from 1 to 7; default is 3
sLONG size = inValue.GetLong();
if (size >= 1 && size <= 7)
{
size = size*12/3; //convert to point
VString fontSize;
fontSize.FromLong(size);
SetFontSize( fontSize, 72.0f);
}
}
}
示例4: _HandlePacket
VError VServiceDiscoveryServer::_HandlePacket (VUDPEndPoint *inEndPoint, uBYTE *inPacket, uLONG inPacketSize, uLONG inBufferSize)
{
xbox_assert(inEndPoint != NULL);
xbox_assert(inPacket != NULL);
uLONG numberQuestions, size, i, offset;
VError error;
const uBYTE *p;
VString vString;
std::list<VServiceRecord>::iterator j;
std::map<VString, bool> queriedServices, queriedAddresses;
std::map<VString, bool>::iterator k;
if (inPacketSize < 12)
return VE_SRVR_BONJOUR_MALFORMED_PACKET;
if ((inPacket[2] & 0x80)
|| (inPacket[3] & 0x0f)
|| !(numberQuestions = Bonjour::Read2Bytes(&inPacket[4])))
return VE_OK;
p = &inPacket[12];
for (i = 0; i < numberQuestions; i++) {
uWORD questionType, questionClass;
size = inPacketSize;
if ((error = Bonjour::ParseDNSName(inPacket, &size, p - inPacket, &vString)) != VE_OK)
return error;
p += size;
questionType = Bonjour::Read2Bytes(p);
questionClass = Bonjour::Read2Bytes(p + 2);
p += 4;
if (questionClass != 1)
continue;
if (questionType == Bonjour::kTypePTR) {
if (vString.EndsWith(".local", true)) {
vString.Truncate(vString.GetLength() - 6);
for (j = fServiceRecords.begin(); j != fServiceRecords.end(); j++)
if (j->fServiceName.EqualToString(vString, true)) {
queriedServices[vString] = true;
break;
} else if (vString.EqualToString("_services._dns-sd._udp", true)) {
queriedServices[vString] = true;
break;
}
}
} else if (questionType == Bonjour::kTypeA)
queriedAddresses[vString] = true;
// Ignore all other types of queries.
}
error = VE_OK;
offset = p - inPacket;
for (k = queriedServices.begin(); k != queriedServices.end(); k++)
if (k->first.EqualToString("_services._dns-sd._udp", true))
error = _SendServiceList(inEndPoint, inPacket, inBufferSize, offset);
else
error = _AnswerQuery(inEndPoint, inPacket, inBufferSize, offset, k->first);
// Note that a hostname can have several network address(es).
for (k = queriedAddresses.begin(); k != queriedAddresses.end(); k++)
for (j = fServiceRecords.begin(); j != fServiceRecords.end(); j++)
if (j->fHostName.EqualToString(k->first, false))
error = _SendAddressAnswer(inEndPoint, inPacket, inBufferSize, offset, *j);
return error;
}