DataSnapshot(const DataSnapshot & snapshot)
DataSnapshot(DataSnapshot && snapshot)
~DataSnapshot()
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. |
DataSnapshotChild(constchar*path)const
Get a DataSnapshot for the location at the specified relative path.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A DataSnapshot corresponding to specified child location. |
DataSnapshotChild(conststd::string&path)const
Get a DataSnapshot for the location at the specified relative path.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A DataSnapshot corresponding to specified child location. |
DataSnapshot()
Default constructor.
This DataSnapshot contains nothing and is considered invalid (i.e. is_valid() == false). Use this to construct an empty DataSnapshot that you will later populate with data from a database callback.
DataSnapshot(constDataSnapshot&snapshot)
Copy constructor.
DataSnapshots are immutable, so they can be efficiently copied.
Details | |||
---|---|---|---|
Parameters |
|
DataSnapshot(DataSnapshot&&snapshot)
Move constructor.
DataSnapshots are immutable, so they can be efficiently moved.
Details | |||
---|---|---|---|
Parameters |
|
DatabaseReferenceGetReference()const
Obtain a DatabaseReference to the source location for this snapshot.
Details | |
---|---|
Returns | A DatabaseReference corresponding to same location as this snapshot. |
boolHasChild(constchar*path)const
Does this DataSnapshot have data at a particular location?
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | True if the snapshot has data at the specified location, false if not. |
boolHasChild(conststd::string&path)const
Does this DataSnapshot have data at a particular location?
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | True if the snapshot has data at the specified location, false if not. |
std::vector<DataSnapshot>children()const
Get all the immediate children of this location.
Details | |
---|---|
Returns | The immediate children of this snapshot. |
size_tchildren_count()const
Get the number of children of this location.
Details | |
---|---|
Returns | The number of immediate children of this snapshot. |
boolexists()const
Returns true if the data is non-empty.
boolhas_children()const
Does this DataSnapshot have any children at all?
Details | |
---|---|
Returns | True if the snapshot has any children, false otherwise. |
boolis_valid()const
Returns true if this snapshot is valid, false if it is not valid.
An invalid snapshot could be returned by a transaction where an error has occurred.
Details | |
---|---|
Returns | true if this snapshot is valid, false if this snapshot is invalid. |
constchar*key()const
Get the key name of the source location of this snapshot.
Details | |
---|---|
Returns | Key name of the source location of this snapshot. |
std::stringkey_string()const
Get the key name of the source location of this snapshot.
Details | |
---|---|
Returns | Key name of the source location of this snapshot. |
DataSnapshot&operator=(constDataSnapshot&snapshot)
Copy assignment operator.
DataSnapshots are immutable, so they can be efficiently copied.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | Reference to the destination DataSnapshot. |
DataSnapshot&operator=(DataSnapshot&&snapshot)
Move assignment operator.
DataSnapshots are immutable, so they can be efficiently moved.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | Reference to this destination DataSnapshot. |
Variantpriority()const
Get the priority of the data contained in this snapshot.
Details | |
---|---|
Returns | The value of this location's Priority relative to its siblings. |
Variantvalue()const
Get the value of the data contained in this snapshot.
Details | |
---|---|
Returns | The value of the data contained in this location. |
~DataSnapshot()
Destructor.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.