firebase:: storage:: Storage
#include <storage.h>
Entry point for the Firebase C++ SDK for CloudStorage.
Summary
To use the SDK, callfirebase::storage::Storage::GetInstance() to obtain an instance ofStorage, then useGetReference() to obtain references to child blobs. From there you can upload data with StorageReference::PutStream(), get data via StorageReference::GetStream().
Constructors and Destructors | |
|---|---|
~Storage()Destructor. |
Public functions | |
|---|---|
GetReference() const | Get aStorageReference to the root of the database. |
GetReference(const char *path) const | Get aStorageReference for the specified path. |
GetReference(const std::string & path) const | Get aStorageReference for the specified path. |
GetReferenceFromUrl(const char *url) const | Get aStorageReference for the provided URL. |
GetReferenceFromUrl(const std::string & url) const | Get aStorageReference for the provided URL. |
UseEmulator(const std::string & host, int port) | voidConfigures theStorage SDK to use an emulated backend instead of the default remote backend. |
UseEmulator(const char *host, int port) | voidConfigures theStorage SDK to use an emulated backend instead of the default remote backend. |
app() | ::firebase::App *Get the firease::App that thisStorage was created with. |
max_download_retry_time() | doubleReturns the maximum time in seconds to retry a download if a failure occurs. |
max_operation_retry_time() | doubleReturns the maximum time to retry operations other than upload and download if a failure occurs. |
max_upload_retry_time() | doubleReturns the maximum time to retry an upload if a failure occurs. |
set_max_download_retry_time(double max_transfer_retry_seconds) | voidSets the maximum time to retry a download if a failure occurs. |
set_max_operation_retry_time(double max_transfer_retry_seconds) | voidSets the maximum time to retry operations other than upload and download if a failure occurs. |
set_max_upload_retry_time(double max_transfer_retry_seconds) | voidSets the maximum time to retry an upload if a failure occurs. |
url() | std::stringGet the URL that thisStorage was created with. |
Public static functions | |
|---|---|
GetInstance(::firebase::App *app,InitResult *init_result_out) | Storage * |
GetInstance(::firebase::App *app, const char *url,InitResult *init_result_out) | Storage * |
Public functions
GetReference
StorageReferenceGetReference(constchar*path)const
Get aStorageReference for the specified path.
GetReference
StorageReferenceGetReference(conststd::string&path)const
Get aStorageReference for the specified path.
GetReferenceFromUrl
StorageReferenceGetReferenceFromUrl(constchar*url)const
Get aStorageReference for the provided URL.
GetReferenceFromUrl
StorageReferenceGetReferenceFromUrl(conststd::string&url)const
Get aStorageReference for the provided URL.
UseEmulator
voidUseEmulator(conststd::string&host,intport)
UseEmulator
voidUseEmulator(constchar*host,intport)
app
::firebase::App*app()
Get the firease::App that thisStorage was created with.
| Details | |
|---|---|
| Returns | Thefirebase::App thisStorage was created with. |
max_download_retry_time
doublemax_download_retry_time()
Returns the maximum time in seconds to retry a download if a failure occurs.
max_operation_retry_time
doublemax_operation_retry_time()
Returns the maximum time to retry operations other than upload and download if a failure occurs.
max_upload_retry_time
doublemax_upload_retry_time()
Returns the maximum time to retry an upload if a failure occurs.
set_max_download_retry_time
voidset_max_download_retry_time(doublemax_transfer_retry_seconds)
Sets the maximum time to retry a download if a failure occurs.
Defaults to 600 seconds (10 minutes).
set_max_operation_retry_time
voidset_max_operation_retry_time(doublemax_transfer_retry_seconds)
Sets the maximum time to retry operations other than upload and download if a failure occurs.
Defaults to 120 seconds (2 minutes).
set_max_upload_retry_time
voidset_max_upload_retry_time(doublemax_transfer_retry_seconds)
Sets the maximum time to retry an upload if a failure occurs.
Defaults to 600 seconds (10 minutes).
url
std::stringurl()
~Storage
~Storage()
Public static functions
GetInstance
Storage*GetInstance(::firebase::App*app,InitResult*init_result_out)
Get an instance ofStorage corresponding to the givenApp.
CloudStorage usesfirebase::App to communicate with Firebase Authentication to authenticate users to the server backend.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
| ||||
| Returns |
GetInstance
Storage*GetInstance(::firebase::App*app,constchar*url,InitResult*init_result_out)
Get an instance ofStorage corresponding to the givenApp, with the given CloudStorage URL.
CloudStorage usesfirebase::App to communicate with Firebase Authentication to authenticate users to the server backend.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
| ||||||
| Returns |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-18 UTC.