本文整理汇总了C++中CContext::AddDeviceContext方法的典型用法代码示例。如果您正苦于以下问题:C++ CContext::AddDeviceContext方法的具体用法?C++ CContext::AddDeviceContext怎么用?C++ CContext::AddDeviceContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContext
的用法示例。
在下文中一共展示了CContext::AddDeviceContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseContexts
bool CConfigParser::ParseContexts(DOMNodeList* contextNodes, ADeviceListener& configClass)
{
ASSERT(contextNodes->getLength() == 1);
DOMNode* contextNode = contextNodes->item(0);
DOMNodeList* contexts = contextNode->getChildNodes();
for(unsigned long idx = 0; idx < contexts->getLength(); idx++)
{
DOMNode* currentContext = contexts->item(idx);
wstring contextNodeName = currentContext->getNodeName();
if(contextNodeName.compare(L"#text") == 0)
continue;
wstring contextName = currentContext->getAttributes()->getNamedItem(L"name")->getNodeValue();
CContext* contextToAdd = new CContext();
unsigned long attrLen = currentContext->getAttributes()->getLength();
for(unsigned long attr = 0; attr < attrLen; attr++)
{
DOMNode* deviceContextAttr = currentContext->getAttributes()->item(attr);
if(wcscmp(deviceContextAttr->getNodeName(), L"deviceContext") == 0)
{
wstring deviceContextName = deviceContextAttr->getNodeValue();
CDeviceContext* deviceContext = configClass.GetDeviceContexts()[deviceContextName];
IDeviceCapture* device = configClass.GetDevices()[deviceContext->GetDeviceName()];
contextToAdd->AddDeviceContext(device, deviceContext);
}
}
configClass.AddContext(contextName, contextToAdd);
}
return true;
}