本文整理汇总了C++中JSONValue::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ JSONValue::Set方法的具体用法?C++ JSONValue::Set怎么用?C++ JSONValue::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSONValue
的用法示例。
在下文中一共展示了JSONValue::Set方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveJSON
bool Component::SaveJSON(JSONValue& dest) const
{
// Write type and ID
dest.Set("type", GetTypeName());
dest.Set("id", (int) id_);
// Write attributes
return Animatable::SaveJSON(dest);
}
示例2: SaveSettingsInternal
bool TypeScriptImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
if (!AssetImporter::SaveSettingsInternal(jsonRoot))
return false;
JSONValue import;
import.Set("IsComponentFile", JSONValue(isComponentFile_));
jsonRoot.Set("TypeScriptImporter", import);
return true;
}
示例3: Write
void MacBuildSettings::Write(JSONValue& parent)
{
JSONValue json;
json.Set("appName", appName_);
json.Set("packageName", packageName_);
json.Set("companyName", companyName_);
json.Set("productName", productName_);
parent.Set("MacBuildSettings", json);
}
示例4: SaveSettingsInternal
bool NETAssemblyImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
if (!AssetImporter::SaveSettingsInternal(jsonRoot))
return false;
JSONValue import;
import.SetType(JSON_OBJECT);
import.Set("AssemblyJSON", assemblyJSON_);
jsonRoot.Set("NETAssemblyImporter", import);
return true;
}
示例5: SaveSettingsInternal
bool MaterialImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
if (!AssetImporter::SaveSettingsInternal(jsonRoot))
return false;
JSONValue import(JSONValue::emptyObject);
jsonRoot.Set("MaterialImporter", import);
return true;
}
示例6: SaveSettingsInternal
bool CSharpImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
if (!AssetImporter::SaveSettingsInternal(jsonRoot))
return false;
JSONValue import;
jsonRoot.Set("CSharpImporter", import);
return true;
}
示例7: SaveSettingsInternal
bool TextureImporter::SaveSettingsInternal(JSONValue& jsonRoot)
{
if (!AssetImporter::SaveSettingsInternal(jsonRoot))
return false;
JSONValue import(JSONValue::emptyObject);
import.Set("compressionSize", compressedSize_);
jsonRoot.Set("TextureImporter", import);
return true;
}
示例8: SaveJSON
bool UnknownComponent::SaveJSON(JSONValue& dest) const
{
if (!useXML_)
ATOMIC_LOGWARNING("UnknownComponent loaded in binary mode, attributes will be empty for JSON save");
// Write type and ID
dest.Set("type", GetTypeName());
dest.Set("id", (int) id_);
JSONArray attributesArray;
attributesArray.Reserve(xmlAttributeInfos_.Size());
for (unsigned i = 0; i < xmlAttributeInfos_.Size(); ++i)
{
JSONValue attrVal;
attrVal.Set("name", xmlAttributeInfos_[i].name_);
attrVal.Set("value", xmlAttributes_[i]);
attributesArray.Push(attrVal);
}
dest.Set("attributes", attributesArray);
return true;
}
示例9: SaveJSON
bool ObjectAnimation::SaveJSON(JSONValue& dest) const
{
JSONValue attributeAnimationsValue;
for (HashMap<String, SharedPtr<ValueAnimationInfo> >::ConstIterator i = attributeAnimationInfos_.Begin();
i != attributeAnimationInfos_.End(); ++i)
{
JSONValue animValue;
animValue.Set("name", i->first_);
const ValueAnimationInfo* info = i->second_;
if (!info->GetAnimation()->SaveJSON(animValue))
return false;
animValue.Set("wrapmode", wrapModeNames[info->GetWrapMode()]);
animValue.Set("speed", (float) info->GetSpeed());
attributeAnimationsValue.Set(i->first_, animValue);
}
dest.Set("attributeanimations", attributeAnimationsValue);
return true;
}
示例10: SaveJSON
bool Animatable::SaveJSON(JSONValue& dest) const
{
if (!Serializable::SaveJSON(dest))
return false;
// Object animation without name
if (objectAnimation_ && objectAnimation_->GetName().Empty())
{
JSONValue objectAnimationValue;
if (!objectAnimation_->SaveJSON(objectAnimationValue))
return false;
dest.Set("objectanimation", objectAnimationValue);
}
JSONValue attributeAnimationValue;
for (HashMap<String, SharedPtr<AttributeAnimationInfo> >::ConstIterator i = attributeAnimationInfos_.Begin();
i != attributeAnimationInfos_.End(); ++i)
{
ValueAnimation* attributeAnimation = i->second_->GetAnimation();
if (attributeAnimation->GetOwner())
continue;
const AttributeInfo& attr = i->second_->GetAttributeInfo();
JSONValue attributeValue;
attributeValue.Set("name", attr.name_);
if (!attributeAnimation->SaveJSON(attributeValue))
return false;
attributeValue.Set("wrapmode", wrapModeNames[i->second_->GetWrapMode()]);
attributeValue.Set("speed", (float) i->second_->GetSpeed());
attributeAnimationValue.Set(attr.name_, attributeValue);
}
return true;
}
示例11: SaveJSON
bool ValueAnimation::SaveJSON(JSONValue& dest) const
{
dest.Set("interpolationmethod", interpMethodNames[interpolationMethod_]);
if (interpolationMethod_ == IM_SPLINE)
dest.Set("splinetension", (float) splineTension_);
JSONArray keyFramesArray;
keyFramesArray.Reserve(keyFrames_.Size());
for (unsigned i = 0; i < keyFrames_.Size(); ++i)
{
const VAnimKeyFrame& keyFrame = keyFrames_[i];
JSONValue keyFrameVal;
keyFrameVal.Set("time", keyFrame.time_);
JSONValue valueVal;
valueVal.SetVariant(keyFrame.value_);
keyFrameVal.Set("value", valueVal);
keyFramesArray.Push(keyFrameVal);
}
dest.Set("keyframes", keyFramesArray);
JSONArray eventFramesArray;
eventFramesArray.Reserve(eventFrames_.Size());
for (unsigned i = 0; i < eventFrames_.Size(); ++i)
{
const VAnimEventFrame& eventFrame = eventFrames_[i];
JSONValue eventFrameVal;
eventFrameVal.Set("time", eventFrame.time_);
eventFrameVal.Set("eventtype", eventFrame.eventType_.Value());
JSONValue eventDataVal;
eventDataVal.SetVariantMap(eventFrame.eventData_);
eventFrameVal.Set("eventdata", eventDataVal);
eventFramesArray.Push(eventFrameVal);
}
dest.Set("eventframes", eventFramesArray);
return true;
}