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

Commit1f8746d

Browse files
committed
Add back getPtr functions.
1 parent7c89e0d commit1f8746d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

‎src/Firebase.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,49 @@ FirebaseGet Firebase::get(const std::string& path) {
4646
returnFirebaseGet(host_, auth_, path, http_);
4747
}
4848

49+
unique_ptr<FirebaseGet>Firebase::getPtr(const std::string& path) {
50+
return unique_ptr<FirebaseGet>(newFirebaseGet(host_, auth_, path, http_));
51+
}
52+
4953
FirebaseSetFirebase::set(const std::string& path,const std::string& value) {
5054
returnFirebaseSet(host_, auth_, path, value, http_);
5155
}
5256

57+
unique_ptr<FirebaseSet>Firebase::setPtr(const std::string& path,
58+
const std::string& value) {
59+
return unique_ptr<FirebaseSet>(
60+
newFirebaseSet(host_, auth_, path, value, http_));
61+
}
62+
5363
FirebasePushFirebase::push(const std::string& path,const std::string& value) {
5464
returnFirebasePush(host_, auth_, path, value, http_);
5565
}
5666

67+
unique_ptr<FirebasePush>Firebase::pushPtr(const std::string& path,const std::string& value) {
68+
return unique_ptr<FirebasePush>(
69+
newFirebasePush(host_, auth_, path, value, http_));
70+
}
71+
5772
FirebaseRemoveFirebase::remove(const std::string& path) {
5873
returnFirebaseRemove(host_, auth_, path, http_);
5974
}
6075

76+
unique_ptr<FirebaseRemove>Firebase::removePtr(const std::string& path) {
77+
return unique_ptr<FirebaseRemove>(
78+
newFirebaseRemove(host_, auth_, path, http_));
79+
}
80+
6181
FirebaseStreamFirebase::stream(const std::string& path) {
6282
// TODO: create new client dedicated to stream.
6383
returnFirebaseStream(host_, auth_, path, http_);
6484
}
6585

86+
unique_ptr<FirebaseStream>Firebase::streamPtr(const std::string& path) {
87+
// TODO: create new client dedicated to stream.
88+
return unique_ptr<FirebaseStream>(
89+
newFirebaseStream(host_, auth_, path, http_));
90+
}
91+
6692
// FirebaseCall
6793
FirebaseCall::FirebaseCall(const std::string& host,const std::string& auth,
6894
constchar* method,const std::string& path,

‎src/Firebase.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,23 @@ class Firebase {
4343

4444
// Fetch json encoded `value` at `path`.
4545
FirebaseGetget(const std::string& path);
46+
virtual std::unique_ptr<FirebaseGet>getPtr(const std::string& path);
47+
4648
// Set json encoded `value` at `path`.
4749
FirebaseSetset(const std::string& path,const std::string& json);
50+
virtual std::unique_ptr<FirebaseSet>setPtr(const std::string& path,const std::string& json);
4851

4952
// Add new json encoded `value` to list at `path`.
5053
FirebasePushpush(const std::string& path,const std::string& json);
54+
virtual std::unique_ptr<FirebasePush>pushPtr(const std::string& path,const std::string& json);
5155

5256
// Delete value at `path`.
5357
FirebaseRemoveremove(const std::string& path);
58+
virtual std::unique_ptr<FirebaseRemove>removePtr(const std::string& path);
5459

5560
// Start a stream of events that affect value at `path`.
5661
FirebaseStreamstream(const std::string& path);
62+
virtual std::unique_ptr<FirebaseStream>streamPtr(const std::string& path);
5763

5864
protected:
5965
// Used for testing.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp