当前位置: 首页>>代码示例>>C++>>正文


C++ VariantType::SetString方法代码示例

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


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

示例1: EncodeString

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

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

示例2: SetString

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

示例3: 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

示例4: EncodeVariant

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

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

示例5: 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,代码来源:

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: UIStaticText

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

    UIStaticText *baseControl = new UIStaticText();

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

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

    //TextColor
    const Color &textColor = GetTextColor();
    if (baseControl->GetTextColor() != textColor)
    {
        nodeValue->SetColor(textColor);
        node->Set("textcolor", nodeValue);
    }

    // Text Color Inherit Type.
    int32 colorInheritType = (int32)GetTextBackground()->GetColorInheritType();
    if (baseControl->GetTextBackground()->GetColorInheritType() != colorInheritType)
    {
        node->Set("textcolorInheritType", loader->GetColorInheritTypeNodeValue(colorInheritType));
    }

    // ShadowColor
    const Color &shadowColor = GetShadowColor();
    if (baseControl->GetShadowColor() != shadowColor)
    {
        nodeValue->SetColor(shadowColor);
        node->Set("shadowcolor", nodeValue);
    }

    // Shadow Color Inherit Type.
    colorInheritType = (int32)GetShadowBackground()->GetColorInheritType();
    if (baseControl->GetShadowBackground()->GetColorInheritType() != colorInheritType)
    {
        node->Set("shadowcolorInheritType", loader->GetColorInheritTypeNodeValue(colorInheritType));
    }

    // ShadowOffset
    const Vector2 &shadowOffset = GetShadowOffset();
    if (baseControl->GetShadowOffset() != shadowOffset)
    {
        nodeValue->SetVector2(shadowOffset);
        node->Set("shadowoffset", nodeValue);
    }

    //Text
    const WideString &text = GetText();
    if (baseControl->GetText() != text)
    {
        node->Set("text", text);
    }
    //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 - Array of strings
    if (baseControl->textBlock->GetFittingOption() != this->textBlock->GetFittingOption())
    {
        node->SetNodeToMap("fitting", loader->GetFittingOptionNodeValue(textBlock->GetFittingOption()));
    }

    // Text Align
    if (baseControl->GetTextAlign() != this->GetTextAlign())
    {
        node->SetNodeToMap("textalign", loader->GetAlignNodeValue(this->GetTextAlign()));
    }

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

    SafeDelete(nodeValue);
    SafeRelease(baseControl);

    return node;
}
开发者ID:galek,项目名称:dava.framework,代码行数:91,代码来源:UIStaticText.cpp

示例11: SetString

void KeyedArchive::SetString(const String & key, const String & value)
{
	VariantType variantValue;
	variantValue.SetString(value);
	objectMap[key] = variantValue;
}
开发者ID:dheerendra1,项目名称:dava.framework,代码行数:6,代码来源:KeyedArchive.cpp


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