• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ VariantType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中VariantType的典型用法代码示例。如果您正苦于以下问题:C++ VariantType类的具体用法?C++ VariantType怎么用?C++ VariantType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VariantType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: VariantType

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;
}
开发者ID:galek,项目名称:dava.framework,代码行数:32,代码来源:KeyedArchive.cpp


示例2: DeleteKey

void KeyedArchive::SetMatrix4(const String & key, const Matrix4 &value)
{
    DeleteKey(key);
	VariantType *variantValue = new VariantType();
	variantValue->SetMatrix4(value);
	objectMap[key] = variantValue;
}
开发者ID:galek,项目名称:dava.framework,代码行数:7,代码来源:KeyedArchive.cpp


示例3: DeleteKey

void KeyedArchive::SetByteArray(const String & key, const uint8 * value, int32 arraySize)
{
    DeleteKey(key);
	VariantType *variantValue = new VariantType();
	variantValue->SetByteArray(value, arraySize);
	objectMap[key] = variantValue;
}
开发者ID:,项目名称:,代码行数:7,代码来源:


示例4: equals

    bool equals (const ValueUnion& data, const ValueUnion& otherData, const VariantType& otherType) const noexcept override
    {
        if (otherType.isDouble() || otherType.isString())
            return otherType.equals (otherData, data, *this);

        return otherType.toInt64 (otherData) == data.int64Value;
    }
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:7,代码来源:juce_Variant.cpp


示例5: VariantType

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;
}
开发者ID:,项目名称:,代码行数:27,代码来源:


示例6: EncodeVariant

void KeyedArchiver::EncodeVariant(const String & key, const VariantType & value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    value.Write(archive);
}
开发者ID:,项目名称:,代码行数:8,代码来源:


示例7: Save

bool KeyedArchive::Save(File *archive)
{
	for (Map<String, VariantType>::iterator it = objectMap.begin(); it != objectMap.end(); ++it)
	{
		VariantType key;
		key.SetString(it->first);
		key.Write(archive);
		it->second.Write(archive);
	}
	return true;
}
开发者ID:dheerendra1,项目名称:dava.framework,代码行数:11,代码来源:KeyedArchive.cpp


示例8: while

bool KeyedUnarchiver::UnarchiveFile(File *file)
{
	while(!file->IsEof())
	{
		VariantType key;
		key.Read(file);
		VariantType value;
		value.Read(file);
		objectMap[key.AsString()] = value;
	}
	return true;
}
开发者ID:,项目名称:,代码行数:12,代码来源:


示例9: while

bool KeyedArchive::Load(File *archive)
{
	while(!archive->IsEof())
	{
		VariantType key;
		key.Read(archive);
		if (archive->IsEof())break;
		VariantType value;
		value.Read(archive);
		objectMap[key.AsString()] = value;
	}
	return true;
}
开发者ID:dheerendra1,项目名称:dava.framework,代码行数:13,代码来源:KeyedArchive.cpp


示例10:

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;
}
开发者ID:galek,项目名称:dava.framework,代码行数:17,代码来源:RecentFilesManager.cpp


示例11: Save

bool KeyedArchive::Save(File *archive)
{
    char header[2];
    uint16 version = 1;
    header[0] = 'K'; header[1] = 'A';
    
    archive->Write(header, 2);
    archive->Write(&version, 2);
    uint32 size = objectMap.size();
    archive->Write(&size, 4);
    
	for (Map<String, VariantType*>::iterator it = objectMap.begin(); it != objectMap.end(); ++it)
	{
		VariantType key;
		key.SetString(it->first);
		key.Write(archive);
		it->second->Write(archive);
	}
	return true;
}
开发者ID:galek,项目名称:dava.framework,代码行数:20,代码来源:KeyedArchive.cpp


示例12: while

bool KeyedArchive::Load(File *archive)
{
    char header[2];
    archive->Read(header, 2);
    if ((header[0] != 'K') || (header[1] != 'A'))
    {
        archive->Seek(0,File::SEEK_FROM_START);
        while(!archive->IsEof())
        {
            VariantType key;
            key.Read(archive);
            if (archive->IsEof())break;
            VariantType *value = new VariantType();
            value->Read(archive);
            objectMap[key.AsString()] = value;
        }
        return true;
    }
    
    uint16 version = 0;
    archive->Read(&version, 2);
    if (version != 1)
    {
        Logger::Error("[KeyedArchive] error loading keyed archive, because version is incorrect");
        return false;
    }
    uint32 numberOfItems = 0;
    archive->Read(&numberOfItems, 4);
    
    for (uint32 item = 0; item < numberOfItems; ++item)
	{
		VariantType key;
		key.Read(archive);
		if (archive->IsEof())break;
        VariantType *value = new VariantType();
        value->Read(archive);
		objectMap[key.AsString()] = value;
	}
	return true;
}
开发者ID:galek,项目名称:dava.framework,代码行数:40,代码来源:KeyedArchive.cpp


示例13: UIStaticText

YamlNode * UIStaticText::SaveToYamlNode(UIYamlLoader * loader)
{
    YamlNode *node = UIControl::SaveToYamlNode(loader);

	UIStaticText *baseControl = new UIStaticText();	

    //Temp variable
    VariantType *nodeValue = new VariantType();
    
    //Control Type
	SetPreferredNodeType(node, "UIStaticText");

    //Font
    //Get font name and put it here
    nodeValue->SetString(FontManager::Instance()->GetFontName(this->GetFont()));
    node->Set("font", nodeValue);

	//TextColor
	nodeValue->SetVector4(Vector4(textColor.r, textColor.g, textColor.b, textColor.a));
	node->Set("textcolor", nodeValue);

	// ShadowColor
	nodeValue->SetVector4(Vector4(shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a));
	node->Set("shadowcolor", nodeValue);

	// ShadowOffset
	nodeValue->SetVector2(GetShadowOffset());
	node->Set("shadowoffset", nodeValue);

    //Text
    nodeValue->SetWideString(GetText());
    node->Set("text", nodeValue);    
    //Multiline
	if (baseControl->textBlock->GetMultiline() != this->textBlock->GetMultiline())
	{
    	node->Set("multiline", this->textBlock->GetMultiline());
	}
    //multilineBySymbol
	if (baseControl->textBlock->GetMultilineBySymbol() != this->textBlock->GetMultilineBySymbol())
	{
    	node->Set("multilineBySymbol", this->textBlock->GetMultilineBySymbol());
	}
    //fitting - STRING OF INT???
	if (baseControl->textBlock->GetFittingOption() != this->textBlock->GetFittingOption())
	{
    	node->Set("fitting", this->textBlock->GetFittingOption());
	}
    
	// Align
	node->SetNodeToMap("textalign", loader->GetAlignNodeValue(this->GetTextAlign()));

	// Draw type. Must be overriden for UITextControls.
	node->Set("drawType", loader->GetDrawTypeNodeValue(this->GetBackground()->GetDrawType()));

    SafeDelete(nodeValue);
	SafeRelease(baseControl);
    
    return node;
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:59,代码来源:UIStaticText.cpp


示例14: VariantType

YamlNode * UIStaticText::SaveToYamlNode(UIYamlLoader * loader)
{
    YamlNode *node = UIControl::SaveToYamlNode(loader);

    // Sprite node is not needed for UITextField.
    YamlNode *spriteNode = node->Get("sprite");
    if (spriteNode)
    {
        node->RemoveNodeFromMap("sprite");
    }

    //Temp variable
    VariantType *nodeValue = new VariantType();
    
    //Control Type
    node->Set("type", "UIStaticText");

    //Font
    //Get font name and put it here
    nodeValue->SetString(FontManager::Instance()->GetFontName(this->GetFont()));
    node->Set("font", nodeValue);

    //Text
    nodeValue->SetWideString(GetText());
    node->Set("text", nodeValue);    
    //Multiline
    node->Set("multiline", this->textBlock->GetMultiline());
    //multilineBySymbol
    node->Set("multilineBySymbol", this->textBlock->GetMultilineBySymbol());
    //fitting - STRING OF INT???  
    node->Set("fitting", this->textBlock->GetFittingOption());
    
    SafeDelete(nodeValue);
    
    return node;
}
开发者ID:dima-belsky,项目名称:dava.framework,代码行数:36,代码来源:UIStaticText.cpp


示例15: EncodeBool

void KeyedArchiver::EncodeBool(const String & key, bool value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetBool(value);
    valueMT.Write(archive);
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例16:

void KeyedArchiver::EncodeInt32(const String & key, int32 value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetInt32(value);
    valueMT.Write(archive);
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例17: EncodeFloat

void KeyedArchiver::EncodeFloat(const String & key, float32 value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetFloat(value);
    valueMT.Write(archive);
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例18: EncodeWideString

void KeyedArchiver::EncodeWideString(const String & key, const WideString & value)
{
    VariantType keyMT;
    keyMT.SetString(key);
    keyMT.Write(archive);

    VariantType valueMT;
    valueMT.SetWideString(value);
    valueMT.Write(archive);
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例19: VariantType

YamlNode * UITextField::SaveToYamlNode(UIYamlLoader * loader)
{
    YamlNode *node = UIControl::SaveToYamlNode(loader);

    //Temp variable
    VariantType *nodeValue = new VariantType();

    //Control Type
	SetPreferredNodeType(node, "UITextField");

    //Text
    nodeValue->SetWideString(this->GetText());
    node->Set("text", nodeValue);

    //Font
    //Get font name and put it here
    nodeValue->SetString(FontManager::Instance()->GetFontName(this->GetFont()));
    node->Set("font", nodeValue);
	
	//TextColor
	Color textColor = GetTextColor();
	nodeValue->SetVector4(Vector4(textColor.r, textColor.g, textColor.b, textColor.a));
	node->Set("textcolor", nodeValue);

	// ShadowColor
	Color shadowColor = GetShadowColor();
	nodeValue->SetVector4(Vector4(shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a));
	node->Set("shadowcolor", nodeValue);

	// ShadowOffset
	nodeValue->SetVector2(GetShadowOffset());
	node->Set("shadowoffset", nodeValue);

	// Text align
	node->SetNodeToMap("textalign", loader->GetAlignNodeValue(this->GetTextAlign()));

	// Draw Type must be overwritten fot UITextField.
	UIControlBackground::eDrawType drawType =  this->GetBackground()->GetDrawType();
	node->Set("drawType", loader->GetDrawTypeNodeValue(drawType));

    SafeDelete(nodeValue);
    
    return node;
}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:44,代码来源:UITextField.cpp


示例20: equals

 bool equals (const ValueUnion& data, const ValueUnion& otherData, const VariantType& otherType) const throw()
 {
     return otherType.toInt (otherData) == data.intValue;
 }
开发者ID:Labmind,项目名称:GUI,代码行数:4,代码来源:juce_Variant.cpp



注:本文中的VariantType类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VariantVector类代码示例发布时间:2022-05-31
下一篇:
C++ VariantMap类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap