本文整理汇总了C++中NF_SHARE_PTR::GetInstancePath方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetInstancePath方法的具体用法?C++ NF_SHARE_PTR::GetInstancePath怎么用?C++ NF_SHARE_PTR::GetInstancePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetInstancePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool NFCElementModule::Load()
{
if (mbLoaded)
{
return false;
}
NF_SHARE_PTR<NFIClass> pLogicClass = m_pClassModule->First();
while (pLogicClass.get())
{
const std::string& strInstancePath = pLogicClass->GetInstancePath();
if (strInstancePath.empty())
{
pLogicClass = m_pClassModule->Next();
continue;
}
//////////////////////////////////////////////////////////////////////////
rapidxml::xml_document<> xDoc;
char* pData = NULL;
int nDataSize = 0;
std::string strFile = pPluginManager->GetConfigPath() + strInstancePath;
rapidxml::file<> fdoc(strFile.c_str());
nDataSize = fdoc.size();
pData = new char[nDataSize + 1];
strncpy(pData, fdoc.data(), nDataSize);
pData[nDataSize] = 0;
xDoc.parse<0>(pData);
//////////////////////////////////////////////////////////////////////////
//support for unlimited layer class inherits
rapidxml::xml_node<>* root = xDoc.first_node();
for (rapidxml::xml_node<>* attrNode = root->first_node(); attrNode; attrNode = attrNode->next_sibling())
{
Load(attrNode, pLogicClass);
}
mbLoaded = true;
//////////////////////////////////////////////////////////////////////////
if (NULL != pData)
{
delete []pData;
}
//////////////////////////////////////////////////////////////////////////
pLogicClass = m_pClassModule->Next();
}
return true;
}
示例2: Load
bool NFCElementInfoModule::Load()
{
if (mbLoaded)
{
return false;
}
NF_SHARE_PTR<NFILogicClass> pLogicClass = m_pLogicClassModule->First();
while (pLogicClass.get())
{
const std::string& strInstancePath = pLogicClass->GetInstancePath();
if (strInstancePath.length() == 0)
{
pLogicClass = m_pLogicClassModule->Next();
continue;
}
std::string strFileData;
NFCLogicClassModule::ReadFileToString(pPluginManager->GetConfigPath() + strInstancePath, strFileData);
std::string strDecode = NFCLogicClassModule::Decode(strFileData);
const int nDataSize = strDecode.length();
char* data = new char[nDataSize + 1];
strncpy(data, strDecode.data(), strDecode.length());
data[nDataSize] = 0;
rapidxml::xml_document<> doc;
doc.parse<0>(data);
//support for unlimited layer class inherits
rapidxml::xml_node<>* root = doc.first_node();
for (rapidxml::xml_node<>* attrNode = root->first_node(); attrNode; attrNode = attrNode->next_sibling())
{
Load(attrNode, pLogicClass);
}
mbLoaded = true;
pLogicClass = m_pLogicClassModule->Next();
}
return true;
}
示例3: Load
bool NFCElementModule::Load()
{
if (mbLoaded)
{
return false;
}
NF_SHARE_PTR<NFIClass> pLogicClass = m_pClassModule->First();
while (pLogicClass)
{
const std::string& strInstancePath = pLogicClass->GetInstancePath();
if (strInstancePath.empty())
{
pLogicClass = m_pClassModule->Next();
continue;
}
//////////////////////////////////////////////////////////////////////////
std::string strFile = pPluginManager->GetConfigPath() + strInstancePath;
std::string strContent;
pPluginManager->GetFileContent(strFile, strContent);
rapidxml::xml_document<> xDoc;
xDoc.parse<0>((char*)strContent.c_str());
//////////////////////////////////////////////////////////////////////////
//support for unlimited layer class inherits
rapidxml::xml_node<>* root = xDoc.first_node();
for (rapidxml::xml_node<>* attrNode = root->first_node(); attrNode; attrNode = attrNode->next_sibling())
{
Load(attrNode, pLogicClass);
}
mbLoaded = true;
pLogicClass = m_pClassModule->Next();
}
return true;
}