diff options
author | Konstantin Varlamov <var-const@users.noreply.github.com> | 2018-02-09 19:42:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 19:42:28 -0500 |
commit | 80033485be537acaf29924f6b717c777b550a418 (patch) | |
tree | 25c3cd3cf2d53e98767aa6ea3ae51384327e5245 /Firestore/core/src/firebase/firestore/model/field_path.cc | |
parent | 612d99c759741bd6384102f586aed1b3874cf95b (diff) |
C++ port: add C++ equivalent of FSTDocumentKey. (#762)
Also move kDocumentKeyPath to the only point of usage - make it a static
member variable of FieldPath.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/model/field_path.cc')
-rw-r--r-- | Firestore/core/src/firebase/firestore/model/field_path.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Firestore/core/src/firebase/firestore/model/field_path.cc b/Firestore/core/src/firebase/firestore/model/field_path.cc index 0da2319..bc0e97c 100644 --- a/Firestore/core/src/firebase/firestore/model/field_path.cc +++ b/Firestore/core/src/firebase/firestore/model/field_path.cc @@ -30,9 +30,6 @@ namespace model { namespace { -// TODO(varconst): move to C++ equivalent of FSTDocumentKey.{h,cc} -const char* const kDocumentKeyPath = "__name__"; - /** * True if the string could be used as a segment in a field path without * escaping. Valid identifies follow the regex [a-zA-Z_][a-zA-Z0-9_]* @@ -146,12 +143,12 @@ const FieldPath& FieldPath::EmptyPath() { } const FieldPath& FieldPath::KeyFieldPath() { - static const FieldPath key_field_path{kDocumentKeyPath}; + static const FieldPath key_field_path{FieldPath::kDocumentKeyPath}; return key_field_path; } bool FieldPath::IsKeyFieldPath() const { - return size() == 1 && first_segment() == kDocumentKeyPath; + return size() == 1 && first_segment() == FieldPath::kDocumentKeyPath; } std::string FieldPath::CanonicalString() const { |