From 2ae36f1e9671b40723dd06462b4a416e4baa5a57 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Thu, 8 Mar 2018 11:53:37 -0500 Subject: [De]Serialize FieldValue map_values ("Objects") (#878) These can (recursively) contain other FieldValues. --- Firestore/core/src/firebase/firestore/model/field_value.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/model/field_value.h') diff --git a/Firestore/core/src/firebase/firestore/model/field_value.h b/Firestore/core/src/firebase/firestore/model/field_value.h index cb219f5..fc8619d 100644 --- a/Firestore/core/src/firebase/firestore/model/field_value.h +++ b/Firestore/core/src/firebase/firestore/model/field_value.h @@ -111,6 +111,11 @@ class FieldValue { return string_value_; } + const std::map& object_value() const { + FIREBASE_ASSERT(tag_ == Type::Object); + return object_value_; + } + /** factory methods. */ static const FieldValue& NullValue(); static const FieldValue& TrueValue(); @@ -134,10 +139,8 @@ class FieldValue { static FieldValue GeoPointValue(const GeoPoint& value); static FieldValue ArrayValue(const std::vector& value); static FieldValue ArrayValue(std::vector&& value); - static FieldValue ObjectValue( - const std::map& value); - static FieldValue ObjectValue( - std::map&& value); + static FieldValue ObjectValue(const std::map& value); + static FieldValue ObjectValue(std::map&& value); friend bool operator<(const FieldValue& lhs, const FieldValue& rhs); @@ -164,7 +167,7 @@ class FieldValue { firebase::firestore::model::ReferenceValue reference_value_; GeoPoint geo_point_value_; std::vector array_value_; - std::map object_value_; + std::map object_value_; }; }; -- cgit v1.2.3