本文整理汇总了C++中VariantType::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ VariantType::GetType方法的具体用法?C++ VariantType::GetType怎么用?C++ VariantType::GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VariantType
的用法示例。
在下文中一共展示了VariantType::GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadFromYamlNode
bool KeyedArchive::LoadFromYamlNode(YamlNode* rootNode)
{
if(NULL == rootNode)
{
return false;
}
Vector<YamlNode*> &rootVector = rootNode->Get(VariantType::TYPENAME_KEYED_ARCHIVE)->AsVector();
for (Vector<YamlNode*>::const_iterator it = rootVector.begin(); it != rootVector.end(); ++it)
{
YamlNode * node = *it;
String variableNameToArchMap = node->AsString();
VariantType *value = new VariantType(node->AsVariantType());
if(value->GetType() == VariantType::TYPE_NONE)
{
SafeDelete(value);
continue;
}
objectMap[variableNameToArchMap] = value;
}
return true;
}
示例2: LoadFromYamlNode
bool KeyedArchive::LoadFromYamlNode(const YamlNode* rootNode)
{
if(NULL == rootNode)
{
return false;
}
const YamlNode * archieveNode = rootNode->Get(VariantType::TYPENAME_KEYED_ARCHIVE);
if(!archieveNode)
{
return false;
}
int32 count = archieveNode->GetCount();
for (int32 i = 0; i < count; ++i)
{
const YamlNode * node = archieveNode->Get(i);
const String &variableNameToArchMap = archieveNode->GetItemKeyName(i);
VariantType *value = new VariantType(node->AsVariantType());
if(value->GetType() == VariantType::TYPE_NONE)
{
SafeDelete(value);
continue;
}
objectMap[variableNameToArchMap] = value;
}
return true;
}
示例3:
DAVA::Vector<String> RecentFilesManager::GetRecentFiles()
{
DAVA::Vector<String> retVector;
VariantType recentFilesVariant = SettingsManager::GetValue(Settings::Internal_RecentFiles);
if(recentFilesVariant.GetType() == DAVA::VariantType::TYPE_KEYED_ARCHIVE)
{
KeyedArchive* archiveRecentFiles = recentFilesVariant.AsKeyedArchive();
DAVA::uint32 size = archiveRecentFiles->Count();
retVector.resize(size);
for (DAVA::uint32 i = 0; i < size; ++i)
{
retVector[i] = archiveRecentFiles->GetString(Format("%d", i));
}
}
return retVector;
}