Μετάβαση στην κονσόλα

firebase::database::DataSnapshot

#include <data_snapshot.h>

A DataSnapshot instance contains data from a Firebase Database location.

Summary

Any time you read Database data, you receive the data as a DataSnapshot. These are efficiently-generated and cannot be changed. To modify data, use DatabaseReference::SetValue() or DatabaseReference::RunTransaction().

Constructors and Destructors

DataSnapshot()
Default constructor.
DataSnapshot(const DataSnapshot & snapshot)
Copy constructor.
DataSnapshot(DataSnapshot && snapshot)
Move constructor.
~DataSnapshot()
Destructor.

Public functions

Child(const char *path) const
Get a DataSnapshot for the location at the specified relative path.
Child(const std::string & path) const
Get a DataSnapshot for the location at the specified relative path.
GetReference() const
Obtain a DatabaseReference to the source location for this snapshot.
HasChild(const char *path) const
bool
Does this DataSnapshot have data at a particular location?
HasChild(const std::string & path) const
bool
Does this DataSnapshot have data at a particular location?
children() const
std::vector< DataSnapshot >
Get all the immediate children of this location.
children_count() const
size_t
Get the number of children of this location.
exists() const
bool
Returns true if the data is non-empty.
has_children() const
bool
Does this DataSnapshot have any children at all?
is_valid() const
bool
Returns true if this snapshot is valid, false if it is not valid.
key() const
const char *
Get the key name of the source location of this snapshot.
key_string() const
std::string
Get the key name of the source location of this snapshot.
operator=(const DataSnapshot & snapshot)
Copy assignment operator.
operator=(DataSnapshot && snapshot)
Move assignment operator.
priority() const
Get the priority of the data contained in this snapshot.
value() const
Get the value of the data contained in this snapshot.

Public functions

Child

DataSnapshot Child(
  const char *path
) const 

Get a DataSnapshot for the location at the specified relative path.

Details
Parameters
path
Path relative to this snapshot's location. It only needs to be valid during this call.
Returns
A DataSnapshot corresponding to specified child location.

Child

DataSnapshot Child(
  const std::string & path
) const 

Get a DataSnapshot for the location at the specified relative path.

Details
Parameters
path
Path relative to this snapshot's location.
Returns
A DataSnapshot corresponding to specified child location.

DataSnapshot