本文整理汇总了C++中NameValues::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ NameValues::push_back方法的具体用法?C++ NameValues::push_back怎么用?C++ NameValues::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameValues
的用法示例。
在下文中一共展示了NameValues::push_back方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDeviceList
void SSDPExtension::GetDeviceList( HTTPRequest *pRequest )
{
LOG(VB_UPNP, LOG_DEBUG, "SSDPExtension::GetDeviceList");
QString sXML;
QTextStream os(&sXML, QIODevice::WriteOnly);
uint nDevCount, nEntryCount;
SSDPCache::Instance()->OutputXML(os, &nDevCount, &nEntryCount);
NameValues list;
list.push_back(
NameValue("DeviceCount", (int)nDevCount));
list.push_back(
NameValue("DevicesAllocated", SSDPCacheEntries::g_nAllocated));
list.push_back(
NameValue("CacheEntriesFound", (int)nEntryCount));
list.push_back(
NameValue("CacheEntriesAllocated", DeviceLocation::g_nAllocated));
list.push_back(
NameValue("DeviceList", sXML));
pRequest->FormatActionResponse(list);
pRequest->m_eResponseType = ResponseTypeXML;
pRequest->m_nResponseStatus = 200;
}
示例2: HandleRegisterDevice
void UPnpMSRR::HandleRegisterDevice( HTTPRequest *pRequest )
{
/* Sure, register, we don't really care */
VERBOSE(VB_UPNP, QString("UPnpMSRR::HandleRegisterDevice"));
NameValues list;
list.push_back(NameValue("Result", "1"));
pRequest->FormatActionResponse(list);
}
示例3: HandleGetFeatureList
void UPnpCMGR::HandleGetFeatureList(HTTPRequest* pRequest)
{
NameValues list;
QString sResults = m_features.toXML();
list.push_back(NameValue("FeatureList", sResults));
pRequest->FormatActionResponse(list);
}
示例4: HandleIsAuthorized
void UPnpMSRR::HandleIsAuthorized( HTTPRequest *pRequest )
{
/* Always tell the user they are authorized to access this data */
VERBOSE(VB_UPNP, QString("UPnpMSRR::HandleIsAuthorized"));
NameValues list;
list.push_back(NameValue("Result", "1"));
list.back().AddAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");
list.back().AddAttribute("dt:dt", "int");
pRequest->FormatActionResponse(list);
}
示例5: HandleGetSystemUpdateID
void UPnpCDS::HandleGetSystemUpdateID( HTTPRequest *pRequest )
{
NameValues list;
LOG(VB_UPNP, LOG_INFO,
QString("UPnpCDS::ProcessRequest : %1 : %2")
.arg(pRequest->m_sBaseUrl) .arg(pRequest->m_sMethod));
unsigned short nId = GetValue<unsigned short>("SystemUpdateID");
list.push_back(NameValue("Id", nId));
pRequest->FormatActionResponse(list);
}
示例6: HandleIsValidated
void UPnpMSRR::HandleIsValidated( HTTPRequest *pRequest )
{
/* You are valid sir */
VERBOSE(VB_UPNP, QString("UPnpMSRR::HandleIsValidated"));
NameValues list;
list.push_back(NameValue("Result", "1"));
list.back().AddAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");
list.back().AddAttribute( "dt:dt", "int");
pRequest->FormatActionResponse(list);
}
示例7: HandleGetSortCapabilities
void UPnpCDS::HandleGetSortCapabilities( HTTPRequest *pRequest )
{
NameValues list;
LOG(VB_UPNP, LOG_INFO,
QString("UPnpCDS::ProcessRequest : %1 : %2")
.arg(pRequest->m_sBaseUrl) .arg(pRequest->m_sMethod));
// -=>TODO: Need to implement based on CDS Extension Capabilities
list.push_back(
NameValue("SortCaps",
"dc:title,dc:creator,dc:date,upnp:class,[email protected]"));
pRequest->FormatActionResponse(list);
}
示例8: HandleSearch
//.........这里部分代码省略.........
request.m_sSearchList = request.m_sSearchCriteria.split(
rMatch, QString::SkipEmptyParts);
request.m_sSearchClass = "object"; // Default to all objects.
// ----------------------------------------------------------------------
// -=>TODO: Need to process all expressions in searchCriteria... for now,
// Just focus on the "upnp:class derivedfrom" expression
// ----------------------------------------------------------------------
for ( QStringList::Iterator it = request.m_sSearchList.begin();
it != request.m_sSearchList.end();
++it )
{
if ((*it).contains("upnp:class derivedfrom", Qt::CaseInsensitive))
{
QStringList sParts = (*it).split(' ', QString::SkipEmptyParts);
if (sParts.count() > 2)
{
request.m_sSearchClass = sParts[2].trimmed();
request.m_sSearchClass.remove( '"' );
break;
}
}
}
// ----------------------------------------------------------------------
LOG(VB_UPNP, LOG_INFO, QString("UPnpCDS::ProcessRequest \n"
": url = %1 \n"
": Method = %2 \n"
": ObjectId = %3 \n"
": SearchCriteria = %4 \n"
": Filter = %5 \n"
": StartingIndex = %6 \n"
": RequestedCount = %7 \n"
": SortCriteria = %8 \n"
": SearchClass = %9" )
.arg( pRequest->m_sBaseUrl )
.arg( pRequest->m_sMethod )
.arg( request.m_sObjectId )
.arg( request.m_sSearchCriteria)
.arg( request.m_sFilter )
.arg( request.m_nStartingIndex )
.arg( request.m_nRequestedCount)
.arg( request.m_sSortCriteria )
.arg( request.m_sSearchClass ));
#if 0
bool bSearchDone = false;
#endif
UPnpCDSExtensionList::iterator it = m_extensions.begin();
for (; (it != m_extensions.end()) && !pResult; ++it)
pResult = (*it)->Search(&request);
if (pResult != NULL)
{
eErrorCode = pResult->m_eErrorCode;
sErrorDesc = pResult->m_sErrorDesc;
if (eErrorCode == UPnPResult_Success)
{
FilterMap filter = (FilterMap) request.m_sFilter.split(',');
nNumberReturned = pResult->m_List.count();
nTotalMatches = pResult->m_nTotalMatches;
nUpdateID = pResult->m_nUpdateID;
sResultXML = pResult->GetResultXML(filter);
#if 0
bSearchDone = true;
#endif
}
delete pResult;
}
#if 0
nUpdateID = 0;
LOG(VB_UPNP, LOG_DEBUG, sResultXML);
#endif
if (eErrorCode == UPnPResult_Success)
{
NameValues list;
QString sResults = DIDL_LITE_BEGIN;
sResults += sResultXML;
sResults += DIDL_LITE_END;
list.push_back(NameValue("Result", sResults));
list.push_back(NameValue("NumberReturned", nNumberReturned));
list.push_back(NameValue("TotalMatches", nTotalMatches));
list.push_back(NameValue("UpdateID", nUpdateID));
pRequest->FormatActionResponse(list);
}
else
UPnp::FormatErrorResponse( pRequest, eErrorCode, sErrorDesc );
}
示例9: HandleBrowse
//.........这里部分代码省略.........
if (request.m_nRequestedCount == 0)
request.m_nRequestedCount = nTotalMatches;
short nStart = Max( request.m_nStartingIndex, short( 0 ));
short nCount = Min( nTotalMatches, request.m_nRequestedCount );
UPnpCDSRequest childRequest;
DetermineClient( pRequest, &request );
childRequest.m_sParentId = "0";
childRequest.m_eBrowseFlag = CDS_BrowseMetadata;
childRequest.m_sFilter = "";
childRequest.m_nStartingIndex = 0;
childRequest.m_nRequestedCount = 1;
childRequest.m_sSortCriteria = "";
for (uint i = nStart;
(i < (uint)m_extensions.size()) &&
(nNumberReturned < nCount);
i++)
{
UPnpCDSExtension *pExtension = m_extensions[i];
childRequest.m_sObjectId = pExtension->m_sExtensionId;
pResult = pExtension->Browse( &childRequest );
if (pResult != NULL)
{
if (pResult->m_eErrorCode == UPnPResult_Success)
{
sResultXML += pResult->GetResultXML(filter);
nNumberReturned ++;
}
delete pResult;
}
}
break;
}
default: break;
}
}
else
{
// ------------------------------------------------------------------
// Look for a CDS Extension that knows how to handle this ObjectID
// ------------------------------------------------------------------
UPnpCDSExtensionList::iterator it = m_extensions.begin();
for (; (it != m_extensions.end()) && !pResult; ++it)
{
LOG(VB_UPNP, LOG_INFO,
QString("UPNP Browse : Searching for : %1 / ObjectID : %2")
.arg((*it)->m_sExtensionId).arg(request.m_sObjectId));
pResult = (*it)->Browse(&request);
}
if (pResult != NULL)
{
eErrorCode = pResult->m_eErrorCode;
sErrorDesc = pResult->m_sErrorDesc;
if (eErrorCode == UPnPResult_Success)
{
nNumberReturned = pResult->m_List.count();
nTotalMatches = pResult->m_nTotalMatches;
nUpdateID = pResult->m_nUpdateID;
sResultXML = pResult->GetResultXML(filter);
}
delete pResult;
}
}
// ----------------------------------------------------------------------
// Output Results of Browse Method
// ----------------------------------------------------------------------
if (eErrorCode == UPnPResult_Success)
{
NameValues list;
QString sResults = DIDL_LITE_BEGIN;
sResults += sResultXML;
sResults += DIDL_LITE_END;
list.push_back(NameValue("Result", sResults));
list.push_back(NameValue("NumberReturned", nNumberReturned));
list.push_back(NameValue("TotalMatches", nTotalMatches));
list.push_back(NameValue("UpdateID", nUpdateID));
pRequest->FormatActionResponse(list);
}
else
UPnp::FormatErrorResponse ( pRequest, eErrorCode, sErrorDesc );
}