summaryrefslogtreecommitdiffstats
path: root/xmrstak/misc/jext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/misc/jext.hpp')
-rw-r--r--xmrstak/misc/jext.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmrstak/misc/jext.hpp b/xmrstak/misc/jext.hpp
new file mode 100644
index 0000000..dce73a0
--- /dev/null
+++ b/xmrstak/misc/jext.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+using namespace rapidjson;
+
+/* This macro brings rapidjson more in line with other libs */
+inline const Value* GetObjectMember(const Value& obj, const char* key)
+{
+ Value::ConstMemberIterator itr = obj.FindMember(key);
+ if (itr != obj.MemberEnd())
+ return &itr->value;
+ else
+ return nullptr;
+}
OpenPOWER on IntegriCloud