本文整理汇总了C++中json::Value::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Value::ToString方法的具体用法?C++ Value::ToString怎么用?C++ Value::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类json::Value
的用法示例。
在下文中一共展示了Value::ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: valueToString
void JsonStream::valueToString(json::Value &value, std::string& str)
{
if(value.GetType() == json::StringVal)
{
str = value.ToString();
}
else
{
mIsOk = false;
mErrorLog += "JsonStream::valueToString() Error: wrong type\n";
}
}
示例2: ParseSampler
Sampler::Ptr SamplerLoader::ParseSampler(ResourceManager& resourceManager, const json::Value& root)
{
if (root.GetType() == StringVal)
{
return resourceManager.LoadResource<Sampler>(root.ToString());
}
SamplerDescription description;
description.samplingMode = ParseSamplingMode(root["sampling"].ToString("basic"));
description.anisotropicEnabled = root["anisotropicEnabled"].ToBool(false);
description.minFilter = ParseInterpolatioMode(root["minFilter"].ToString("linear"));
description.magFilter = ParseInterpolatioMode(root["magFilter"].ToString("linear"));
description.mipFilter = ParseInterpolatioMode(root["mipFilter"].ToString("linear"));
description.uWrap = ParseEdgeSampling(root["uWrap"].ToString("clamp"));
description.vWrap = ParseEdgeSampling(root["vWrap"].ToString("clamp"));
description.wWrap = ParseEdgeSampling(root["wWrap"].ToString("clamp"));
description.useMipMap = root["useMipMap"].ToBool(description.useMipMap);
description.mipBias = root["mipBias"].ToFloat(description.mipBias);
description.minLOD = root["minLOD"].ToFloat(description.minLOD);
description.maxLOD = root["maxLOD"].ToFloat(description.maxLOD);
description.compareFunction = JsonTypeHelper::ParseCompareFunction(root["compareFunction"].ToString("never"));
description.maxAnisotropy = root["maxAnisotropy"].ToInt(description.maxAnisotropy);
if (root.HasKey("borderColor"))
{
description.borderColor = JsonTypeHelper::ParseColor(root["borderColor"]);
}
return resourceManager.GetGraphics()->CreateSampler(description);
}