本文整理汇总了C++中CIwGameString::URLEncode方法的典型用法代码示例。如果您正苦于以下问题:C++ CIwGameString::URLEncode方法的具体用法?C++ CIwGameString::URLEncode怎么用?C++ CIwGameString::URLEncode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIwGameString
的用法示例。
在下文中一共展示了CIwGameString::URLEncode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequestAdAdFonic
//
//
//
// AdFonic specific implementation
//
//
//
bool CIwGameAds::RequestAdAdFonic()
{
// Get device surface dimensions
Width = IwGxGetScreenWidth();
Height = IwGxGetScreenHeight();
CIwGameString urlencoded;
RequestURI = "http://adfonic.net/ad/";
RequestURI += ApplicationID;
RequestURI += "?";
RequestURI += "r.id=";
urlencoded.URLEncode(CIwGameString(UDID).c_str());
RequestURI += urlencoded;
RequestURI += "&s.test=0";
RequestURI += "&t.format=xml";
if (!ExtraInfo.IsEmpty())
{
RequestURI += ExtraInfo;
}
AdRequest.setGET();
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.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例2: RequestAdVServ
//
//
//
// VServ specific implementation
//
//
//
bool CIwGameAds::RequestAdVServ()
{
// Get device surface dimensions
Width = IwGxGetScreenWidth();
Height = IwGxGetScreenHeight();
// Build M2M request URI string
RequestURI = "http://a.vserv.mobi/delivery/adapi.php?";
CIwGameString urlencoded;
RequestURI += "zoneid=";
RequestURI += ApplicationID;
RequestURI += "&im=";
RequestURI += CIwGameString(UDID);
RequestURI += "&ic=";
RequestURI += s3eDeviceGetString(S3E_DEVICE_LOCALE);
RequestURI += "&app=1";
RequestURI += "&ts=1";
RequestURI += "&ua=";
urlencoded.URLEncode(UserAgent.c_str());
RequestURI += urlencoded;
if (Width != 0)
{
RequestURI += "&sw=";
RequestURI += CIwGameString(Width);
}
if (Height != 0)
{
RequestURI += "&sh=";
RequestURI += CIwGameString(Height);
}
if (!ExtraInfo.IsEmpty())
{
RequestURI += ExtraInfo;
}
AdRequest.setGET();
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", "0");
AdRequest.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例3: RequestAdMillennialMedia
//
//
//
// MillennialMedia specific implementation
//
//
//
bool CIwGameAds::RequestAdMillennialMedia()
{
// Build M2M request URI string
//RequestURI = "http://ads.mp.mydas.mobi/getAd.php5?";
RequestURI = "http://ads.mydas.mobi/getAd?";
CIwGameString urlencoded;
RequestURI += "apid=";
RequestURI += ApplicationID;
RequestURI += "&auid=";
RequestURI += CIwGameString(UDID);
RequestURI += "&ua=";
urlencoded.URLEncode(UserAgent.c_str());
RequestURI += urlencoded;
// RequestURI += "&mode=test";
// RequestURI += "&uip=";
// RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
if (UserAge != 0)
{
RequestURI += "&age=";
RequestURI += CIwGameString(UserAge);
}
if (UserGender != GenderInvalid)
{
if (UserGender == GenderFemale)
RequestURI += "&gender=female";
else
RequestURI += "&gender=male";
}
if (!ExtraInfo.IsEmpty())
{
RequestURI += ExtraInfo;
}
AdRequest.setGET();
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", "0");
AdRequest.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例4: RequestAdKomliMobile
//
//
//
// KomliMobile specific implementation
//
//
//
bool CIwGameAds::RequestAdKomliMobile()
{
// Get device surface dimensions
Width = IwGxGetScreenWidth();
Height = IwGxGetScreenHeight();
// Build M2M request URI string
RequestURI = "http://a.zestadz.com/waphandler/deliverad?";
CIwGameString urlencoded;
RequestURI += "ip=";
RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
RequestURI += "&cid=";
RequestURI += ApplicationID;
RequestURI += "&ua=";
urlencoded.URLEncode(UserAgent.c_str());
RequestURI += urlencoded;
RequestURI += "&response_type=xml";
// RequestURI += CIwGameString(UDID);
if (!ExtraInfo.IsEmpty())
{
RequestURI += ExtraInfo;
}
AdRequest.setGET();
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", "0");
AdRequest.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例5: RequestAdAdModa
//
//
//
// AdModa specific implementation
//
//
//
bool CIwGameAds::RequestAdAdModa()
{
// Get device surface dimensions
Width = IwGxGetScreenWidth();
Height = IwGxGetScreenHeight();
// Build M2M request URI string
RequestURI = "http://www.admoda.com/ads/fetch.php?";
CIwGameString urlencoded;
RequestURI += "v=4";
RequestURI += "&l=php";
RequestURI += "&z=";
RequestURI += ApplicationID;
// RequestURI += "&a=";
// RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
RequestURI += "&ua=";
urlencoded.URLEncode(UserAgent.c_str());
RequestURI += urlencoded;
if (!ExtraInfo.IsEmpty())
{
RequestURI += ExtraInfo;
}
AdRequest.setGET();
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", "0");
AdRequest.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例6: 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;
}
示例7: 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;
}
示例8: RequestAdMojiva
//
//
//
// Mojiva specific implementation
//
//
//
bool CIwGameAds::RequestAdMojiva()
{
// Build M2M request URI string
RequestURI = "http://ads.mojiva.com/ad?";
CIwGameString urlencoded;
RequestURI += "zone=";
RequestURI += ApplicationID;
RequestURI += "&ip=";
RequestURI += IW_GAME_HTTP_MANAGER->getIPAddress();
urlencoded.URLEncode(UserAgent.c_str());
RequestURI += urlencoded;
RequestURI += "&udid=";
RequestURI += CIwGameString(UDID);
if (!ExtraInfo.IsEmpty())
{
RequestURI += 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.setGET();
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", "0");
AdRequest.setBody("");
IW_GAME_HTTP_MANAGER->AddRequest(&AdRequest);
BusyTimer.setDuration(IW_GAME_ADS_TIMEOUT);
return true;
}
示例9: 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;
}