firebase::firestore::FieldPath

#include <field_path.h>

A FieldPath refers to a field in a document.

Summary

The path may consist of a single field name (referring to a top level field in the document) or a list of field names (referring to a nested field in the document).

Constructors and Destructors

FieldPath()
Creates an invalid FieldPath that has to be reassigned before it can be used.
FieldPath(std::initializer_list< std::string > field_names)
Creates a FieldPath from the provided field names.
FieldPath(const std::vector< std::string > & field_names)
Creates a FieldPath from the provided field names.
FieldPath(const FieldPath & other)
Copy constructor.
FieldPath(FieldPath && other)
Move constructor.
~FieldPath()

Friend classes

operator<<
friend std::ostream &
Outputs the string representation of this FieldPath to the given stream.
std::hash< FieldPath >
friend struct

Public functions

ToString() const
std::string
Returns a string representation of this FieldPath for logging/debugging purposes.
is_valid() const
bool
Returns true if this FieldPath is valid, false if it is not valid.
operator=(const FieldPath & other)
Copy assignment operator.
operator=(FieldPath && other) noexcept
Move assignment operator.

Public static functions

DocumentId()
A special sentinel FieldPath to refer to the ID of a document.

Friend classes

operator<<

friend std::ostream & operator<<(std::ostream &out, const FieldPath &path)

Outputs the string representation of this FieldPath to the given stream.

See also:ToString() for comments on the representation format.

std::hash< FieldPath >

friend struct std::hash< FieldPath >

Public functions

FieldPath

 FieldPath()

Creates an invalid FieldPath that has to be reassigned before it can be used.

Calling any member function on an invalid FieldPath will be a no-op. If the function returns a value, it will return a zero, empty, or invalid value, depending on the type of the value.

FieldPath

 FieldPath(
  std::initializer_list< std::string > field_names
)

Creates a FieldPath from the provided field names.

If more than one field name is provided, the path will point to a nested field in a document.

Details
Parameters
field_names
A list of field names.

FieldPath

 FieldPath(
  const std::vector< std::string > & field_names
)

Creates a FieldPath from the provided field names.

If more than one field name is provided, the path will point to a nested field in a document.

Details
Parameters
field_names
A vector of field names.

FieldPath

 FieldPath(
  const FieldPath & other
)

Copy constructor.

This performs a deep copy, creating an independent instance.

Details
Parameters
other
FieldPath to copy from.

FieldPath

 FieldPath(
  FieldPath && other
) noexcept

Move constructor.

Moving is more efficient than copying for FieldPath. After being moved from, FieldPath is in a valid but unspecified state.

Details
Parameters
other
FieldPath to move data from.

ToString

std::string ToString() const 

Returns a string representation of this FieldPath for logging/debugging purposes.

is_valid

bool is_valid() const 

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

An invalid FieldPath could be the result of:

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

operator=

FieldPath & operator=(
  const FieldPath & other
)

Copy assignment operator.

This performs a deep copy, creating an independent instance.

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

operator=

FieldPath & operator=(
  FieldPath && other
) noexcept

Move assignment operator.

Moving is more efficient than copying for FieldPath. After being moved from, FieldPath is in a valid but unspecified state.

Details
Parameters
other
FieldPath to move data from.
Returns
Reference to the destination FieldPath.

~FieldPath

 ~FieldPath()

Public static functions

DocumentId

FieldPath DocumentId()

A special sentinel FieldPath to refer to the ID of a document.

It can be used in queries to sort or filter by the document ID.