|
|
@@ -6,7 +6,6 @@
|
|
|
|
|
|
#include <ArduinoJson/Memory/StringNode.hpp>
|
|
|
#include <ArduinoJson/Misc/SerializedValue.hpp>
|
|
|
-#include <ArduinoJson/MsgPack/MsgPackBinary.hpp>
|
|
|
#include <ArduinoJson/Numbers/convertNumber.hpp>
|
|
|
#include <ArduinoJson/Strings/JsonString.hpp>
|
|
|
#include <ArduinoJson/Strings/StringAdapters.hpp>
|
|
|
@@ -49,10 +48,6 @@ class VariantData {
|
|
|
return visit.visit(RawString(content_.asOwnedString->data,
|
|
|
content_.asOwnedString->length));
|
|
|
|
|
|
- case VALUE_IS_BINARY:
|
|
|
- return visit.visit(MsgPackBinary(content_.asOwnedString->data,
|
|
|
- content_.asOwnedString->length));
|
|
|
-
|
|
|
case VALUE_IS_SIGNED_INTEGER:
|
|
|
return visit.visit(content_.asSignedInteger);
|
|
|
|
|
|
@@ -190,16 +185,6 @@ class VariantData {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- MsgPackBinary asBinary() const {
|
|
|
- switch (type()) {
|
|
|
- case VALUE_IS_BINARY:
|
|
|
- return MsgPackBinary(content_.asOwnedString->data,
|
|
|
- content_.asOwnedString->length);
|
|
|
- default:
|
|
|
- return MsgPackBinary(nullptr, 0);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
VariantData* getElement(size_t index,
|
|
|
const ResourceManager* resources) const {
|
|
|
return ArrayData::getElement(asArray(), index, resources);
|
|
|
@@ -289,10 +274,6 @@ class VariantData {
|
|
|
return type() == VALUE_IS_LINKED_STRING || type() == VALUE_IS_OWNED_STRING;
|
|
|
}
|
|
|
|
|
|
- bool isBinary() const {
|
|
|
- return type() == VALUE_IS_BINARY;
|
|
|
- }
|
|
|
-
|
|
|
size_t nesting(const ResourceManager* resources) const {
|
|
|
auto collection = asCollection();
|
|
|
if (collection)
|
|
|
@@ -413,28 +394,6 @@ class VariantData {
|
|
|
var->setRawString(value, resources);
|
|
|
}
|
|
|
|
|
|
- void setBinary(StringNode* s) {
|
|
|
- ARDUINOJSON_ASSERT(s);
|
|
|
- setType(VALUE_IS_BINARY);
|
|
|
- content_.asOwnedString = s;
|
|
|
- }
|
|
|
-
|
|
|
- void setBinary(MsgPackBinary value, ResourceManager* resources) {
|
|
|
- auto dup = resources->saveString(
|
|
|
- adaptString(reinterpret_cast<const char*>(value.data()), value.size()));
|
|
|
- if (dup)
|
|
|
- setBinary(dup);
|
|
|
- else
|
|
|
- setNull();
|
|
|
- }
|
|
|
-
|
|
|
- static void setBinary(VariantData* var, MsgPackBinary value,
|
|
|
- ResourceManager* resources) {
|
|
|
- if (!var)
|
|
|
- return;
|
|
|
- var->setBinary(value, resources);
|
|
|
- }
|
|
|
-
|
|
|
template <typename TAdaptedString>
|
|
|
void setString(TAdaptedString value, ResourceManager* resources) {
|
|
|
setNull(resources);
|