summaryrefslogtreecommitdiffstats
path: root/src/JsonUtils.cpp
diff options
context:
space:
mode:
authorSeppe Degryse <80254822+Griezn@users.noreply.github.com>2023-06-08 08:13:08 +0200
committerGitHub <noreply@github.com>2023-06-08 08:13:08 +0200
commit4fe144de352434ff6e98a4269777b82e8b03f4d0 (patch)
tree6278545a5b10369c1175a058414dc13cb21f500c /src/JsonUtils.cpp
parentUpdate clang-tidy.sh (#5477) (diff)
downloadcuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar.gz
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar.bz2
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar.lz
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar.xz
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.tar.zst
cuberite-4fe144de352434ff6e98a4269777b82e8b03f4d0.zip
Diffstat (limited to 'src/JsonUtils.cpp')
-rw-r--r--src/JsonUtils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/JsonUtils.cpp b/src/JsonUtils.cpp
index 6c70e70d3..2c6c8efbc 100644
--- a/src/JsonUtils.cpp
+++ b/src/JsonUtils.cpp
@@ -40,4 +40,16 @@ bool ParseString(const AString & a_JsonStr, Json::Value & a_Root, AString * a_Er
return Reader->parse(Doc, Doc + a_JsonStr.size(), &a_Root, a_ErrorMsg);
}
+
+
+
+
+AString SerializeSingleValueJsonObject(
+ const AString & a_Key, const AString & a_Value)
+{
+ Json::Value root;
+ root[a_Key] = a_Value;
+ return JsonUtils::WriteFastString(root);
+}
+
} // namespace JsonUtils