From 8311c6432ecff78bedd13e27f64d241659324786 Mon Sep 17 00:00:00 2001 From: zxu Date: Tue, 6 Mar 2018 14:28:04 -0500 Subject: port paths to FSTDocumentKey (#877) * replace path with C++ implementation in FSTDocumentKey.{h,mm} only * address changes * address changes --- Firestore/core/src/firebase/firestore/model/resource_path.h | 5 ++--- Firestore/core/test/firebase/firestore/testutil/testutil.h | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Firestore/core') diff --git a/Firestore/core/src/firebase/firestore/model/resource_path.h b/Firestore/core/src/firebase/firestore/model/resource_path.h index 53c1951..6ff1b68 100644 --- a/Firestore/core/src/firebase/firestore/model/resource_path.h +++ b/Firestore/core/src/firebase/firestore/model/resource_path.h @@ -41,6 +41,8 @@ class ResourcePath : public impl::BasePath { } ResourcePath(std::initializer_list list) : BasePath{list} { } + explicit ResourcePath(SegmentsT&& segments) : BasePath{std::move(segments)} { + } /** * Creates and returns a new path from the given resource-path string, where * the path segments are separated by a slash "/". @@ -70,9 +72,6 @@ class ResourcePath : public impl::BasePath { } private: - explicit ResourcePath(SegmentsT&& segments) : BasePath{std::move(segments)} { - } - // So that methods of base can construct ResourcePath using the private // constructor. friend class BasePath; diff --git a/Firestore/core/test/firebase/firestore/testutil/testutil.h b/Firestore/core/test/firebase/firestore/testutil/testutil.h index 7e4f313..094efc5 100644 --- a/Firestore/core/test/firebase/firestore/testutil/testutil.h +++ b/Firestore/core/test/firebase/firestore/testutil/testutil.h @@ -18,6 +18,7 @@ #define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_TESTUTIL_TESTUTIL_H_ #include "Firestore/core/src/firebase/firestore/model/field_path.h" +#include "Firestore/core/src/firebase/firestore/model/resource_path.h" #include "absl/strings/string_view.h" namespace firebase { @@ -30,6 +31,10 @@ inline model::FieldPath Field(absl::string_view field) { return model::FieldPath::FromServerFormat(field); } +inline model::ResourcePath Resource(absl::string_view field) { + return model::ResourcePath::FromString(field); +} + // Add a non-inline function to make this library buildable. // TODO(zxu123): remove once there is non-inline function. void dummy(); -- cgit v1.2.3