本文整理汇总了C++中URI::parameters方法的典型用法代码示例。如果您正苦于以下问题:C++ URI::parameters方法的具体用法?C++ URI::parameters怎么用?C++ URI::parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::parameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNearProtocol
bool HTTP4CLIProtocol::SignalInputData(IOBuffer &buffer) {
INFO("HTTP4CLI got data");
//1. Get the HTTP protocol. We are sure is a PT_INBOUND_HTTP
//because we return true inside AllowFarProtocol only when type == PT_INBOUND_HTTP
InboundHTTPProtocol *pHTTP = (InboundHTTPProtocol *) GetFarProtocol();
//2. Get the request headers
Variant headers = pHTTP->GetHeaders();
//3. Populate the input buffer for the next protocol in the stack (PT_INBOUND_JSONCLI)
//with the data we just found out inside the headers
URI uri;
string dummy = "http://localhost" + (string) headers[HTTP_FIRST_LINE][HTTP_URL];
FINEST("dummy: %s", STR(dummy));
if (!URI::FromString(dummy, false, uri)) {
FATAL("Invalid request");
return false;
}
string fullCommand = uri.document();
fullCommand += " ";
if (uri.parameters().MapSize() != 0) {
fullCommand += unb64(MAP_VAL(uri.parameters().begin()));
}
fullCommand += "\n";
_localInputBuffer.ReadFromString(fullCommand);
//4. Call the next protocol with the new buffer
return GetNearProtocol()->SignalInputData(_localInputBuffer);
}
示例2: IsAuthedSuccess
bool AppSelectorApplication::IsAuthedSuccess(string uriString) {
URI uri;
string accessToken;
string timeStamp;
string clientId;
if (SystemManager::IsFactoryMode()) {
return true;
}
URI::FromString(uriString, false, uri);
Variant params=uri.parameters();
if (!params.HasKey(URL_CLIENT_ID)) {
clientId=(string)SystemManager::GetNVRam("Login");
}
else {
clientId=(string)params[URL_CLIENT_ID];
}
if (params.HasKey(URL_ACCESS_TOKEN)) {
accessToken=(string)params[URL_ACCESS_TOKEN];
}
if (params.HasKey(URL_TIMESTAMP)) {
timeStamp=(string)params[URL_TIMESTAMP];
}
DEBUG ("clientId:%s, accessToken:%s, timeStamp:%s",
STR(clientId), STR(accessToken), STR(timeStamp));
if (HTTPAuthHelper::IsAuthedSuccess(clientId, accessToken, timeStamp)){
return true;
}
return false;
}