Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad75ff6

Browse files
committed
FirebaseObject: expose getJsonVariant
1 parent11baa52 commitad75ff6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

‎src/FirebaseArduino.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ FirebaseObject FirebaseArduino::readEvent() {
106106
String event = client->readStringUntil('\n').substring(6);
107107
client->readStringUntil('\n');// consume separator
108108
FirebaseObject obj =FirebaseObject(event);
109-
obj["type"] = type;
109+
obj.getJsonVariant().asObject()["type"] = type;
110110
return obj;
111111
}
112112

‎src/FirebaseObject.h‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class FirebaseObject {
6363
*/
6464
StringgetString(const String& path ="");
6565

66+
/**
67+
* Return the value as a JsonVariant.
68+
* \param optional path in the JSON object.
69+
* \return result as a JsonVariant.
70+
*/
71+
JsonVariantgetJsonVariant(const String& path ="");
72+
73+
6674
/**
6775
*
6876
* \return Whether there was an error decoding or accessing the JSON object.
@@ -80,8 +88,8 @@ class FirebaseObject {
8088
* \return Error message if failed() is true.
8189
*/
8290
const String&error()const;
91+
8392
private:
84-
JsonVariantgetJsonVariant(const String& path ="");
8593
String data_;
8694
StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE> buffer_;
8795
JsonVariant json_;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp