|
26 | 26 | // Stub functions to allow sample functions to compile.
|
27 | 27 | void DisplayError(firebase::functions::Error code, const char *message) {}
|
28 | 28 | void DisplayResult(int result) {}
|
29 |
| -void DisplayResult(const string& result) {} |
| 29 | +void DisplayResult(const std::string& result) {} |
30 | 30 |
|
31 | 31 | // [START define_functions_instance]
|
32 | 32 | firebase::functions::Functions* functions;
|
@@ -56,7 +56,7 @@ firebase::Future<firebase::functions::HttpsCallableResult> AddNumbers(int a,
|
56 | 56 |
|
57 | 57 | // [START function_add_message]
|
58 | 58 | firebase::Future<firebase::functions::HttpsCallableResult> AddMessage(
|
59 |
| - const string& text) { |
| 59 | + const std::string& text) { |
60 | 60 | // Create the arguments to the callable function.
|
61 | 61 | firebase::Variant data = firebase::Variant::EmptyMap();
|
62 | 62 | data.map()["text"] = firebase::Variant(text);
|
@@ -119,15 +119,15 @@ void OnAddMessageCallback(
|
119 | 119 | const firebase::functions::HttpsCallableResult *result = future.result();
|
120 | 120 | firebase::Variant data = result->data();
|
121 | 121 | // This will assert if the result returned from the function wasn't a string.
|
122 |
| - string message = data.string_value(); |
| 122 | + std::string message = data.string_value(); |
123 | 123 | // Display the result in the UI.
|
124 | 124 | DisplayResult(message);
|
125 | 125 | }
|
126 | 126 |
|
127 | 127 | // ...
|
128 | 128 |
|
129 | 129 | // [START_EXCLUDE]
|
130 |
| -void AddMessageAndDisplay(const string& message) { |
| 130 | +void AddMessageAndDisplay(const std::string& message) { |
131 | 131 | // [END_EXCLUDE]
|
132 | 132 | auto future = AddMessage(message);
|
133 | 133 | future.OnCompletion(OnAddMessageCallback);
|
|
0 commit comments