summaryrefslogtreecommitdiff
path: root/include/lib/ArduinoJson/Variant/VariantContent.hpp
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-05-12 09:12:09 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-05-12 09:12:09 +0200
commit39895a677e5d370824e702cfe90ebc67737b8482 (patch)
treeff5b4cc9e373d33a795d50d9333e05549bd9f2b8 /include/lib/ArduinoJson/Variant/VariantContent.hpp
parent42e7fdf01c3a5701bb51e93ad6c650c3dbbc5450 (diff)
import ArduinoJson 6.18.0
Diffstat (limited to 'include/lib/ArduinoJson/Variant/VariantContent.hpp')
-rw-r--r--include/lib/ArduinoJson/Variant/VariantContent.hpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/include/lib/ArduinoJson/Variant/VariantContent.hpp b/include/lib/ArduinoJson/Variant/VariantContent.hpp
new file mode 100644
index 0000000..47bf09c
--- /dev/null
+++ b/include/lib/ArduinoJson/Variant/VariantContent.hpp
@@ -0,0 +1,59 @@
+// ArduinoJson - https://arduinojson.org
+// Copyright Benoit Blanchon 2014-2021
+// MIT License
+
+#pragma once
+
+#include <stddef.h> // size_t
+
+#include <ArduinoJson/Collection/CollectionData.hpp>
+#include <ArduinoJson/Numbers/Float.hpp>
+#include <ArduinoJson/Numbers/Integer.hpp>
+
+namespace ARDUINOJSON_NAMESPACE {
+
+//
+enum {
+ VALUE_MASK = 0x7F,
+
+ OWNED_VALUE_BIT = 0x01,
+ VALUE_IS_NULL = 0,
+ VALUE_IS_LINKED_RAW = 0x02,
+ VALUE_IS_OWNED_RAW = 0x03,
+ VALUE_IS_LINKED_STRING = 0x04,
+ VALUE_IS_OWNED_STRING = 0x05,
+
+ // CAUTION: no OWNED_VALUE_BIT below
+
+ VALUE_IS_BOOLEAN = 0x06,
+
+ NUMBER_BIT = 0x08,
+ VALUE_IS_UNSIGNED_INTEGER = 0x08,
+ VALUE_IS_SIGNED_INTEGER = 0x0A,
+ VALUE_IS_FLOAT = 0x0C,
+
+ COLLECTION_MASK = 0x60,
+ VALUE_IS_OBJECT = 0x20,
+ VALUE_IS_ARRAY = 0x40,
+
+ OWNED_KEY_BIT = 0x80
+};
+
+struct RawData {
+ const char *data;
+ size_t size;
+};
+
+union VariantContent {
+ Float asFloat;
+ bool asBoolean;
+ UInt asUnsignedInteger;
+ Integer asSignedInteger;
+ CollectionData asCollection;
+ const char *asString;
+ struct {
+ const char *data;
+ size_t size;
+ } asRaw;
+};
+} // namespace ARDUINOJSON_NAMESPACE