58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
|
From f717a4ceabf2c23fcb03838945865cd54a4698c7 Mon Sep 17 00:00:00 2001
|
||
|
From: Howard Butler <howard@hobu.co>
|
||
|
Date: Thu, 28 Dec 2017 09:05:02 -0600
|
||
|
Subject: [PATCH] jsoncpp changed the return signature of removeMember and we
|
||
|
need to get the same behavior in two steps now (#1759)
|
||
|
|
||
|
---
|
||
|
dimbuilder/DimBuilder.cpp | 13 +++++++++----
|
||
|
1 file changed, 9 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/dimbuilder/DimBuilder.cpp b/dimbuilder/DimBuilder.cpp
|
||
|
index dd2f4a4c7..96b978a67 100644
|
||
|
--- a/dimbuilder/DimBuilder.cpp
|
||
|
+++ b/dimbuilder/DimBuilder.cpp
|
||
|
@@ -174,9 +174,11 @@ bool DimBuilder::execute()
|
||
|
void DimBuilder::extractDim(Json::Value& dim)
|
||
|
{
|
||
|
DimSpec d;
|
||
|
+ Json::Value empty;
|
||
|
|
||
|
// Get dimension name.
|
||
|
- Json::Value name = dim.removeMember("name");
|
||
|
+ Json::Value name = dim.get("name", empty);
|
||
|
+ dim.removeMember("name");
|
||
|
if (name.isNull())
|
||
|
throw dimbuilder_error("Dimension missing name.");
|
||
|
if (!name.isString())
|
||
|
@@ -185,7 +187,8 @@ void DimBuilder::extractDim(Json::Value& dim)
|
||
|
validateDimension(d.m_name);
|
||
|
|
||
|
// Get dimension description.
|
||
|
- Json::Value description = dim.removeMember("description");
|
||
|
+ Json::Value description = dim.get("description", empty);
|
||
|
+ dim.removeMember("description");
|
||
|
if (description.isNull())
|
||
|
{
|
||
|
std::ostringstream oss;
|
||
|
@@ -204,7 +207,8 @@ void DimBuilder::extractDim(Json::Value& dim)
|
||
|
d.m_description = description.asString();
|
||
|
|
||
|
// Get dimension type
|
||
|
- Json::Value type = dim.removeMember("type");
|
||
|
+ Json::Value type = dim.get("type", empty);
|
||
|
+ dim.removeMember("type");
|
||
|
if (type.isNull())
|
||
|
{
|
||
|
std::ostringstream oss;
|
||
|
@@ -222,7 +226,8 @@ void DimBuilder::extractDim(Json::Value& dim)
|
||
|
throw dimbuilder_error(oss.str());
|
||
|
}
|
||
|
|
||
|
- Json::Value altNames = dim.removeMember("alt_names");
|
||
|
+ Json::Value altNames = dim.get("alt_names", empty);
|
||
|
+ dim.removeMember("alt_names");
|
||
|
if (!altNames.isNull())
|
||
|
{
|
||
|
if (!altNames.isString())
|