当前位置: 首页>>代码示例>>C++>>正文


C++ VString::EqualToString方法代码示例

本文整理汇总了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);
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:7,代码来源:VJSTLS.cpp

示例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";
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:26,代码来源:VSpanText.cpp

示例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);
		}
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:22,代码来源:VSpanText.cpp

示例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;
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:96,代码来源:ServiceDiscovery.cpp


注:本文中的VString::EqualToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。