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.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/xmrstak/misc/jext.hpp b/xmrstak/misc/jext.hpp
new file mode 100644
index 0000000..f4a333c
--- /dev/null
+++ b/xmrstak/misc/jext.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+#include "xmrstak/rapidjson/document.h"
+#include "xmrstak/rapidjson/error/en.h"
+
+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