本文整理汇总了C++中NF_SHARE_PTR::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::Find方法的具体用法?C++ NF_SHARE_PTR::Find怎么用?C++ NF_SHARE_PTR::Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::Find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddClassInclude
bool NFCClassModule::AddClassInclude(const char* pstrClassFilePath, NF_SHARE_PTR<NFIClass> pClass)
{
if (pClass->Find(pstrClassFilePath))
{
return false;
}
//////////////////////////////////////////////////////////////////////////
std::string strFile = pPluginManager->GetConfigPath() + pstrClassFilePath;
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();
rapidxml::xml_node<>* pRropertyRootNode = root->first_node("Propertys");
if (pRropertyRootNode)
{
AddPropertys(pRropertyRootNode, pClass);
}
//////////////////////////////////////////////////////////////////////////
//and record
rapidxml::xml_node<>* pRecordRootNode = root->first_node("Records");
if (pRecordRootNode)
{
AddRecords(pRecordRootNode, pClass);
}
rapidxml::xml_node<>* pComponentRootNode = root->first_node("Components");
if (pComponentRootNode)
{
AddComponents(pComponentRootNode, pClass);
}
//pClass->mvIncludeFile.push_back( pstrClassFilePath );
//and include file
rapidxml::xml_node<>* pIncludeRootNode = root->first_node("Includes");
if (pIncludeRootNode)
{
for (rapidxml::xml_node<>* includeNode = pIncludeRootNode->first_node(); includeNode; includeNode = includeNode->next_sibling())
{
const char* pstrIncludeFile = includeNode->first_attribute("Id")->value();
//std::vector<std::string>::iterator it = std::find( pClass->mvIncludeFile.begin(), pClass->mvIncludeFile..end(), pstrIncludeFile );
if (AddClassInclude(pstrIncludeFile, pClass))
{
pClass->Add(pstrIncludeFile);
}
}
}
return true;
}
示例2: AddClass
bool NFCClassModule::AddClass(const char* pstrClassFilePath, NF_SHARE_PTR<NFIClass> pClass)
{
NF_SHARE_PTR<NFIClass> pParent = pClass->GetParent();
while (pParent)
{
//inherited some properties form class of parent
std::string strFileName = "";
pParent->First(strFileName);
while (!strFileName.empty())
{
if (pClass->Find(strFileName))
{
strFileName.clear();
continue;
}
if (AddClassInclude(strFileName.c_str(), pClass))
{
pClass->Add(strFileName);
}
strFileName.clear();
pParent->Next(strFileName);
}
pParent = pParent->GetParent();
}
//////////////////////////////////////////////////////////////////////////
if (AddClassInclude(pstrClassFilePath, pClass))
{
pClass->Add(pstrClassFilePath);
}
//file.close();
return true;
}
示例3: AddClassInclude
bool NFCClassModule::AddClassInclude(const char* pstrClassFilePath, NF_SHARE_PTR<NFIClass> pClass)
{
if (pClass->Find(pstrClassFilePath))
{
return false;
}
//////////////////////////////////////////////////////////////////////////
rapidxml::xml_document<> xDoc;
char* pData = NULL;
int nDataSize = 0;
std::string strFile = pPluginManager->GetConfigPath() + pstrClassFilePath;
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();
rapidxml::xml_node<>* pRropertyRootNode = root->first_node("Propertys");
if (pRropertyRootNode)
{
AddPropertys(pRropertyRootNode, pClass);
}
//////////////////////////////////////////////////////////////////////////
//and record
rapidxml::xml_node<>* pRecordRootNode = root->first_node("Records");
if (pRecordRootNode)
{
AddRecords(pRecordRootNode, pClass);
}
rapidxml::xml_node<>* pComponentRootNode = root->first_node("Components");
if (pComponentRootNode)
{
AddComponents(pComponentRootNode, pClass);
}
//pClass->mvIncludeFile.push_back( pstrClassFilePath );
//and include file
rapidxml::xml_node<>* pIncludeRootNode = root->first_node("Includes");
if (pIncludeRootNode)
{
for (rapidxml::xml_node<>* includeNode = pIncludeRootNode->first_node(); includeNode; includeNode = includeNode->next_sibling())
{
const char* pstrIncludeFile = includeNode->first_attribute("Id")->value();
//std::vector<std::string>::iterator it = std::find( pClass->mvIncludeFile.begin(), pClass->mvIncludeFile..end(), pstrIncludeFile );
if (AddClassInclude(pstrIncludeFile, pClass))
{
pClass->Add(pstrIncludeFile);
}
}
}
//////////////////////////////////////////////////////////////////////////
if (NULL != pData)
{
delete []pData;
}
//////////////////////////////////////////////////////////////////////////
return true;
}