Ir a la consola

firebase::storage::Storage

#include <storage.h>

Entry point for the Firebase C++ SDK for Cloud Storage.

Summary

To use the SDK, call firebase::storage::Storage::GetInstance() to obtain an instance of Storage, then use GetReference() 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 a StorageReference to the root of the database.
GetReference(const char *path) const
Get a StorageReference for the specified path.
GetReference(const std::string & path) const
Get a StorageReference for the specified path.
GetReferenceFromUrl(const char *url) const
Get a StorageReference for the provided URL.
GetReferenceFromUrl(const std::string & url) const
Get a StorageReference for the provided URL.
app()
Get the firease::App that this Storage was created with.
max_download_retry_time()
double
Returns the maximum time in seconds to retry a download if a failure occurs.
max_operation_retry_time()
double
Returns the maximum time to retry operations other than upload and download if a failure occurs.
max_upload_retry_time()
double
Returns the maximum time to retry an upload if a failure occurs.
set_max_download_retry_time(double max_transfer_retry_seconds)
void
Sets the maximum time to retry a download if a failure occurs.
set_max_operation_retry_time(double max_transfer_retry_seconds)
void
Sets 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)
void
Sets the maximum time to retry an upload if a failure occurs.
url()
std::string
Get the URL that this Storage was created with.

Public static functions

GetInstance(::firebase::App *app, InitResult *init_result_out)
Get an instance of Storage corresponding to the given App.
GetInstance(::firebase::App *app, const char *url, InitResult *init_result_out)
Get an instance of Storage corresponding to the given App, with the given Cloud Storage URL.

Public functions

GetReference

StorageReference GetReference() const 

Get a StorageReference to the root of the database.

GetReference

StorageReference GetReference(
  const char *path
) const 

Get a StorageReference for the specified path.

GetReference

StorageReference GetReference(
  const std::string & path
) const 

Get a StorageReference for the specified path.

GetReferenceFromUrl

StorageReference GetReferenceFromUrl(
  const char *url
) const 

Get a StorageReference for the provided URL.

GetReferenceFromUrl

StorageReference GetReferenceFromUrl(
  const std::string & url
) const 

Get a StorageReference for the provided URL.

app

::firebase::App * app()

Get the firease::App that this Storage was created with.

Details
Returns
The firebase::App this Storage was created with.

max_download_retry_time

double max_download_retry_time()

Returns the maximum time in seconds to retry a download if a failure occurs.

max_operation_retry_time

double max_operation_retry_time()

Returns the maximum time to retry operations other than upload and download if a failure occurs.

max_upload_retry_time

double max_upload_retry_time()

Returns the maximum time to retry an upload if a failure occurs.

set_max_download_retry_time

void set_max_download_retry_time(
  double max_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

void set_max_operation_retry_time(
  double max_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).