|
27 | 27 |
|
28 | 28 | //TODO(edcoyne) split these into multiple files.
|
29 | 29 |
|
| 30 | +classFirebaseCall; |
| 31 | +classFirebaseEventStream; |
| 32 | + |
| 33 | +// Primary client to the Firebase backend. |
| 34 | +classFirebase { |
| 35 | +public: |
| 36 | +Firebase(const String& host); |
| 37 | + Firebase&auth(const String& auth); |
| 38 | + |
| 39 | +// Fetch result at "path" to a local variable. If the value is too large you will exceed |
| 40 | +// local memory. |
| 41 | + FirebaseCallget(const String& path); |
| 42 | + |
| 43 | +// Add new value to list at "path", will return child name of new item. |
| 44 | + FirebaseCallpush(const String& path,const String& value); |
| 45 | + |
| 46 | +// Deletes value at "path" from server. |
| 47 | + FirebaseCallremove(const String& path); |
| 48 | + |
| 49 | +// Starts a stream of events that effect object at "path". |
| 50 | + FirebaseEventStreamstream(const String& path); |
| 51 | + |
| 52 | +private: |
| 53 | + HTTPClient http_; |
| 54 | + String host_; |
| 55 | + String auth_; |
| 56 | +}; |
| 57 | + |
30 | 58 | classFirebaseCall {
|
31 | 59 | public:
|
32 | 60 | FirebaseCall(const String& host,const String& auth,
|
@@ -90,28 +118,4 @@ class FirebaseEventStream {
|
90 | 118 | String error_message_;
|
91 | 119 | };
|
92 | 120 |
|
93 |
| -// Primary client to the Firebase backend. |
94 |
| -classFirebase { |
95 |
| -public: |
96 |
| -Firebase(const String& host); |
97 |
| - Firebase&auth(const String& auth); |
98 |
| - |
99 |
| -// Fetch result at "path" to a local variable. If the value is too large you will exceed |
100 |
| -// local memory. |
101 |
| - FirebaseCallget(const String& path); |
102 |
| - |
103 |
| -// Add new value to list at "path", will return child name of new item. |
104 |
| - FirebaseCallpush(const String& path,const String& value); |
105 |
| - |
106 |
| -// Deletes value at "path" from server. |
107 |
| - FirebaseCallremove(const String& path); |
108 |
| - |
109 |
| -// Starts a stream of events that effect object at "path". |
110 |
| - FirebaseEventStreamstream(const String& path); |
111 |
| - |
112 |
| -private: |
113 |
| - HTTPClient http_; |
114 |
| - String host_; |
115 |
| - String auth_; |
116 |
| -}; |
117 | 121 | #endif// firebase_h
|