Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 2ef168c

Browse files
committed
Switched new methods to const String&
1 parent 59f773c commit 2ef168c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/FirebaseArduino.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ FirebaseObject FirebaseArduino::get(const String& path) {
4747
return FirebaseObject(get.response());
4848
}
4949

50-
int FirebaseArduino::getInt(const char* path) {
50+
int FirebaseArduino::getInt(const String& path) {
5151
auto get = FirebaseGet(host_, auth_, path, http_.get());
5252
error_ = get.error();
5353
if (failed()) {
@@ -57,7 +57,7 @@ int FirebaseArduino::getInt(const char* path) {
5757
}
5858

5959

60-
float FirebaseArduino::getFloat(const char* path) {
60+
float FirebaseArduino::getFloat(const String& path) {
6161
auto get = FirebaseGet(host_, auth_, path, http_.get());
6262
error_ = get.error();
6363
if (failed()) {
@@ -66,7 +66,7 @@ float FirebaseArduino::getFloat(const char* path) {
6666
return FirebaseObject(get.response()).getFloat();
6767
}
6868

69-
String FirebaseArduino::getString(const char* path) {
69+
String FirebaseArduino::getString(const String& path) {
7070
auto get = FirebaseGet(host_, auth_, path, http_.get());
7171
error_ = get.error();
7272
if (failed()) {
@@ -75,7 +75,7 @@ String FirebaseArduino::getString(const char* path) {
7575
return FirebaseObject(get.response()).getString();
7676
}
7777

78-
bool FirebaseArduino::getBool(const char* path) {
78+
bool FirebaseArduino::getBool(const String& path) {
7979
auto get = FirebaseGet(host_, auth_, path, http_.get());
8080
error_ = get.error();
8181
if (failed()) {

src/FirebaseArduino.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,31 @@ class FirebaseArduino {
6363
* \param path The path to the node you wish to retrieve.
6464
* \return The integer value located at that path. Will only be populated if success() is true.
6565
*/
66-
int getInt(const char* path);
66+
int getInt(const String& path);
6767

6868
/**
6969
* Gets the float value located at path.
7070
* You should check success() after calling.
7171
* \param path The path to the node you wish to retrieve.
7272
* \return The float value located at that path. Will only be populated if success() is true.
7373
*/
74-
float getFloat(const char* path);
74+
float getFloat(const String& path);
7575

7676
/**
7777
* Gets the string value located at path.
7878
* You should check success() after calling.
7979
* \param path The path to the node you wish to retrieve.
8080
* \return The string value located at that path. Will only be populated if success() is true.
8181
*/
82-
String getString(const char* path);
82+
String getString(const String& path);
8383

8484
/**
8585
* Gets the boolean value located at path.
8686
* You should check success() after calling.
8787
* \param path The path to the node you wish to retrieve.
8888
* \return The boolean value located at that path. Will only be populated if success() is true.
8989
*/
90-
bool getBool(const char* path);
90+
bool getBool(const String& path);
9191

9292
/**
9393
* Gets the json object value located at path.

0 commit comments

Comments
 (0)