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


C++ CIwGameString::GetLength方法代码示例

本文整理汇总了C++中CIwGameString::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ CIwGameString::GetLength方法的具体用法?C++ CIwGameString::GetLength怎么用?C++ CIwGameString::GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIwGameString的用法示例。


在下文中一共展示了CIwGameString::GetLength方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateAttribute

void CIwGameXmlNode::UpdateAttribute(CIwGameString& name, const char* value)
{
	CIwGameXmlAttribute* old_attribute = GetAttribute(name.c_str());

	if (old_attribute == NULL)
	{
		// Attribute was not present so add
		CIwGameXmlAttribute* attribute = CIwGameXmlParser::AllocAttribute();
		attribute->setName((char*)name.c_str(), name.GetLength());
		attribute->setValue((char*)value, strlen(value));
		Attributes.push_back(attribute);
	}
	else
	{
		// Attribute was present so update it
		old_attribute->setName((char*)name.c_str(), name.GetLength());
		old_attribute->setValue((char*)value, strlen(value));
	}
}
开发者ID:marcodeltutto,项目名称:Collider,代码行数:19,代码来源:IwGameXml.cpp

示例2: RequestAdMobFox

//
//
//
//	MobFox specific implementation
//
//
//
bool CIwGameAds::RequestAdMobFox()
{
	// Build request URI string
	RequestURI = "http://my.mobfox.com/request.php";

	CIwGameString body;
	CIwGameString urlencoded;

	body = "rt=api";
	body += "&u=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
	body += "&i=";
	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&o=";
	body += CIwGameString(UDID);
	body += "&m=live";
	body += "&s=";
	body += ApplicationID;
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
开发者ID:agramonte,项目名称:IwGameAds,代码行数:43,代码来源:IwGameAds.cpp

示例3: LoadFromXoml


//.........这里部分代码省略.........
				Format = CIwImage::RGBA_5551;
			else
			if (format_hash == IW_GAME_HASH("RGB_888"))
				Format = CIwImage::RGB_888;
			else
			if (format_hash == IW_GAME_HASH("RGBA_6666"))
				Format = CIwImage::RGBA_6666;
			else
			if (format_hash == IW_GAME_HASH("RGB_332"))
				Format = CIwImage::RGB_332;
			else
			if (format_hash == IW_GAME_HASH("RGBA_8888"))
				Format = CIwImage::RGBA_8888;
			else
			{
				FormatSet = false;
				CIwGameError::LogError("Warning: Invalid texture format set - ", (*it)->GetValue().c_str());
			}
		}
		else
 		if (name_hash == CIwGameXomlNames::Filter_Hash)
			setFilter((*it)->GetValueAsBool());
	}

	if (location == NULL || name == NULL)
		CIwGameError::LogError("Warning: An Image requires a location and a name to be specified");

	if (condition != NULL)
	{
		// Find the condition variable
		bool condition_not = false;
		CIwGameXomlVariable* var = NULL;
		if (*(condition->c_str()) == '!')
		{
			condition_not = true;
			CIwGameString cond = condition->c_str() + 1;
			var = CIwGameXomlVariable::GetVariable(cond, scene);
		}
		else
			var = CIwGameXomlVariable::GetVariable(*condition, scene);
		if (var != NULL)
		{
			bool res = var->isTrue();
			if (condition_not)
				res = !res;
			if (!res)
			{
				IW_GAME_XOML->setExitOnError(false);
				return false;
			}
		}
#if defined (_DEBUG)
		else
			CIwGameError::LogError("Warning: condition variable not found - ", condition->c_str());
#endif // _DEBUG
	}

	if (location != NULL)
	{
		// Check to see if image is located externally
		if (CIwGameFile::isHttp(location->c_str(), location->GetLength()))
		{
			Init(location->c_str());
		}
		else
		if (CIwGameFile::isFile(location->c_str(), location->GetLength()))
		{
			Init(location->c_str());
		}
		else
		{
			// Find resource group
			CIwGameResourceGroup* group = NULL;
			if (parent != NULL && parent->getClassTypeHash() == CIwGameXomlNames::Scene_Hash)
				group = (CIwGameResourceGroup*)scene->getResourceManager()->findResource(location->c_str(), CIwGameXomlNames::ResourceGroup_Hash);
			else
				group = (CIwGameResourceGroup*)IW_GAME_GLOBAL_RESOURCES->getResourceManager()->findResource(location->c_str(), CIwGameXomlNames::ResourceGroup_Hash);

			if (group != NULL)
				Init(name->c_str(), group->getResourceGroup());
			else
			{
				CIwGameError::LogError("Error: XOML - Invalid image resource group name - ", location->c_str());
				return false;
			}
		}
		if (preload)
		{
			Load(blocking);
		}
	}

	// If we are declared inside a scene then image is local to the scene
	if (scene != NULL)
		return scene->getResourceManager()->addResource(this);
	else
		return IW_GAME_GLOBAL_RESOURCES->getResourceManager()->addResource(this);

	return true;
}
开发者ID:marcodeltutto,项目名称:Collider,代码行数:101,代码来源:IwGameImage.cpp

示例4: RequestAdInMobi

//
//
//
//	ImMobi specific implementation
//
//
//
bool CIwGameAds::RequestAdInMobi()
{
	// Build M2M request URI string
	RequestURI = "http://w.inmobi.com/showad.asm";				// Live
//	RequestURI = "http://i.w.sandbox.inmobi.com/showad.asm";	// Test
    
    int slotSize = (int)SlotSize;

	CIwGameString body;
	CIwGameString urlencoded;

	body = "mk-siteid=";
	body += ApplicationID;
	body += "&mk-carrier=";
	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&h-user-agent=";
	urlencoded.URLEncode(UserAgent.c_str());
	urlencoded.ToLower();
	body += urlencoded;
	body += "&u-id=";
	body += CIwGameString(UDID);
	body += "&d-localization=";
	urlencoded.URLEncode(s3eDeviceGetString(S3E_DEVICE_LOCALE));
	urlencoded.ToLower();
	body += urlencoded;
//	body += "&d-netType=wifi";
	body += "&d-netType=carrier";
    body += "&mk-ad-slot=";
    body += CIwGameString(slotSize);
	body += "&mk-version=pr-SPEC-CTATA-20130111";
	if (UserAge != 0)
	{
		body += "&u-age=";
		body += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&u-gender=f";
		else
			body += "&u-gender=m";
	}
	if (!UserGPSLocation.IsEmpty())
	{
		body += "&u-latlong=";
		body += UserGPSLocation;
	}
	if (!UserKeywords.IsEmpty())
	{
		body += "&u-interests=";
		body += UserKeywords;
	}
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}
//	body.ToLower();

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("X-Mkhoj-SiteID", ApplicationID.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
开发者ID:agramonte,项目名称:IwGameAds,代码行数:78,代码来源:IwGameAds.cpp

示例5: RequestAdMadvertise

bool CIwGameAds::RequestAdMadvertise()
{
	// Build M2M request URI string
	RequestURI = "http://ad.madvertise.de/site/";
	RequestURI += ApplicationID;

	CIwGameString body;
	CIwGameString urlencoded;

	body += "ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
//	body += "&ip=";
//	body += IW_GAME_HTTP_MANAGER->getIPAddress();
	body += "&requester=madvertise_api";
	body += "&version=api_2.1";
	body += "&unique_device_id=";
	body += CIwGameString(UDID);
	if (!ExtraInfo.IsEmpty())
	{
		body += ExtraInfo;
	}

/*	CIwGameString local = s3eDeviceGetString(S3E_DEVICE_LOCALE);
	int pos = local.Contains('_');
	if (pos >= 0)
	{
		// Strip language and underscore
		local.setString(local.c_str() + pos + 1, 2);
		local.ToUpper();
		body += "&country=";
		body += local;
	}*/

	if (UserAge != 0)
	{
		body += "&age=";
		body += CIwGameString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&gender=F";
		else
			body += "&gender=M";
	}
	if (!UserKeywords.IsEmpty())
	{
		body += "&keywords=";
		body += UserKeywords;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CIwGameString(body.GetLength()).c_str());
	AdRequest.setBody(body.c_str());
	IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);

	return true;
}
开发者ID:agramonte,项目名称:IwGameAds,代码行数:65,代码来源:IwGameAds.cpp

示例6: Copy

void CIwGameString::Copy(CIwGameString& string)
{
	Copy((char *)string.c_str(), 0, string.GetLength());
}
开发者ID:agramonte,项目名称:IwGameAds,代码行数:4,代码来源:IwGameString.cpp


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