firebase::storage::Metadata

#include <metadata.h>

Metadata stores default attributes such as size and content type.

Summary

Metadata for a StorageReference. You may also store custom metadata key value pairs. Metadata values may be used to authorize operations using declarative validation rules.

Constructors and Destructors

Metadata()
Default constructor.
Metadata(const Metadata & other)
Copy constructor.
Metadata(Metadata && other)
Move constructor.
~Metadata()

Public functions

GetReference() const
Return the associated StorageReference for which this metadata belongs to.
bucket() const
const char *
Return the owning Google Cloud Storage bucket for the StorageReference.
cache_control() const
const char *
Return the Cache Control setting of the StorageReference.
content_disposition() const
const char *
Return the content disposition of the StorageReference.
content_encoding() const
const char *
Return the content encoding for the StorageReference.
content_language() const
const char *
Return the content language for the StorageReference.
content_type() const
const char *
Return the content type of the StorageReference.
creation_time() const
int64_t
Return the time the StorageReference was created in milliseconds since the epoch.
custom_metadata() const
std::map< std::string, std::string > *
Return a map of custom metadata key value pairs.
download_url() const
const char *
Returns a long lived download URL with a revokable token.
download_urls() const
std::vector< std::string >
Return all unguessable Urls that can be used to download the StorageReference.
generation() const
int64_t
Return a version String indicating what version of the StorageReference.
is_valid() const
bool
Returns true if this Metadata is valid, false if it is not valid.
metadata_generation() const
int64_t
Return a version String indicating the version of this StorageMetadata.
name() const
const char *
Return a simple name of the StorageReference object.
operator=(const Metadata & other)
Copy assignment operator.
operator=(Metadata && other)
Move assignment operator.
path() const
const char *
Return the path of the StorageReference object.
set_cache_control(const char *cache_control)
void
Set the Cache Control setting of the StorageReference.
set_cache_control(const std::string & cache_control)
void
Set the Cache Control setting of the StorageReference.
set_content_disposition(const char *disposition)
void
Set the content disposition of the StorageReference.
set_content_disposition(const std::string & disposition)
void
Set the content disposition of the StorageReference.
set_content_encoding(const char *encoding)
void
Set the content encoding for the StorageReference.
set_content_encoding(const std::string & encoding)
void
Set the content encoding for the StorageReference.
set_content_language(const char *language)
void
Set the content language for the StorageReference.
set_content_language(const std::string & language)
void
Set the content language for the StorageReference.
set_content_type(const char *type)
void
Set the content type of the StorageReference.
set_content_type(const std::string & type)
void
Set the content type of the StorageReference.
size_bytes() const
int64_t
Return the stored Size in bytes of the StorageReference object.
updated_time() const
int64_t
Return the time the StorageReference was last updated in milliseconds since the epoch.

Public functions

GetReference

StorageReference GetReference() const 

Return the associated StorageReference for which this metadata belongs to.

Details
Returns
The associated StorageReference for which this metadata belongs. to.

Metadata

 Metadata()

Default constructor.

Metadata

 Metadata(
  const Metadata & other
)

Copy constructor.

Details
Parameters
other
Metadata to copy from.

Metadata

 Metadata(
  Metadata && other
)

Move constructor.

Moving is an efficient operation for Metadata.

Details
Parameters
other
Metadata to move from.

bucket

const char * bucket() const 

Return the owning Google Cloud Storage bucket for the StorageReference.

Details
Returns
The owning Google Cloud Storage bucket for the StorageReference.

cache_control

const char * cache_control() const 

Return the Cache Control setting of the StorageReference.

See also: https://tools.ietf.org/html/rfc7234#section-5.2

Details
Returns
The Cache Control setting of the StorageReference.

content_disposition

const char * content_disposition() const 

Return the content disposition of the StorageReference.

See also: https://tools.ietf.org/html/rfc6266

Details
Returns
The content disposition of the StorageReference.

content_encoding

const char * content_encoding() const 

Return the content encoding for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.11

Details
Returns
The content encoding for the StorageReference.

content_language

const char * content_language() const 

Return the content language for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.12

Details
Returns
The content language for the StorageReference.

content_type

const char * content_type() const 

Return the content type of the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.17

Details
Returns
The content type of the StorageReference.

creation_time

int64_t creation_time() const 

Return the time the StorageReference was created in milliseconds since the epoch.

Details
Returns
The time the StorageReference was created in milliseconds since the epoch.

custom_metadata

std::map< std::string, std::string > * custom_metadata() const 

Return a map of custom metadata key value pairs.

The pointer returned is only valid during the lifetime of the Metadata object that owns it.

Details
Returns
The keys for custom metadata.

download_url

const char * download_url() const 

Returns a long lived download URL with a revokable token.

This can be used to share the file with others, but can be revoked by a developer in the Firebase Console if desired.

Details
Returns
A long lived download URL with a revokable token.

download_urls

std::vector< std::string > download_urls() const 

Return all unguessable Urls that can be used to download the StorageReference.

Details
Returns
All unguessable Urls that can be used to download the StorageReference.

generation

int64_t generation() const 

Return a version String indicating what version of the StorageReference.

Details
Returns
A version String indicating what version of the StorageReference.

is_valid

bool is_valid() const 

Returns true if this Metadata is valid, false if it is not valid.

An invalid Metadata is one that is not associated with any files.

Details
Returns
true if this Metadata is valid, false if this Metadata is invalid.

metadata_generation

int64_t metadata_generation() const 

Return a version String indicating the version of this StorageMetadata.

Details
Returns
A version String indicating the version of this StorageMetadata.

name

const char * name() const 

Return a simple name of the StorageReference object.

Details
Returns
A simple name of the StorageReference object.

operator=

Metadata & operator=(
  const Metadata & other
)

Copy assignment operator.

Details
Parameters
other
Metadata to copy from.
Returns
Reference to the destination Metadata.

operator=

Metadata & operator=(
  Metadata && other
)

Move assignment operator.

Moving is an efficient operation for Metadata.

Details
Parameters
other
Metadata to move from.
Returns
Reference to the destination Metadata.

path

const char * path() const 

Return the path of the StorageReference object.

Details
Returns
The path of the StorageReference object.

set_cache_control

void set_cache_control(
  const char *cache_control
)

Set the Cache Control setting of the StorageReference.

See also: https://tools.ietf.org/html/rfc7234#section-5.2

set_cache_control

void set_cache_control(
  const std::string & cache_control
)

Set the Cache Control setting of the StorageReference.

See also: https://tools.ietf.org/html/rfc7234#section-5.2

set_content_disposition

void set_content_disposition(
  const char *disposition
)

Set the content disposition of the StorageReference.

See also: https://tools.ietf.org/html/rfc6266

set_content_disposition

void set_content_disposition(
  const std::string & disposition
)

Set the content disposition of the StorageReference.

See also: https://tools.ietf.org/html/rfc6266

set_content_encoding

void set_content_encoding(
  const char *encoding
)

Set the content encoding for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.11

set_content_encoding

void set_content_encoding(
  const std::string & encoding
)

Set the content encoding for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.11

set_content_language

void set_content_language(
  const char *language
)

Set the content language for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.12

set_content_language

void set_content_language(
  const std::string & language
)

Set the content language for the StorageReference.

See also: https://tools.ietf.org/html/rfc2616#section-14.12

set_content_type

void set_content_type(
  const char *type
)

set_content_type

void set_content_type(
  const std::string & type
)

size_bytes

int64_t size_bytes() const 

Return the stored Size in bytes of the StorageReference object.

Details
Returns
The stored Size in bytes of the StorageReference object.

updated_time

int64_t updated_time() const 

Return the time the StorageReference was last updated in milliseconds since the epoch.

Details
Returns
The time the StorageReference was last updated in milliseconds since the epoch.

~Metadata

 ~Metadata()

Send feedback about...

Need help? Visit our support page.