mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-11 22:55:59 +05:45
... based on things learned porting Timestamps. There's no good way to include conversions equivalent to toGeoPoint in FIRTimestamp, so pull out separate conversion functions that match other similar things.
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
/*
|
|
* Copyright 2019 Google
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#include "Firestore/Source/API/converters.h"
|
|
|
|
#import "FIRGeoPoint.h"
|
|
|
|
#include "Firestore/core/include/firebase/firestore/geo_point.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
namespace firebase {
|
|
namespace firestore {
|
|
namespace api {
|
|
|
|
GeoPoint MakeGeoPoint(FIRGeoPoint* geo_point) {
|
|
return GeoPoint(geo_point.latitude, geo_point.longitude);
|
|
}
|
|
|
|
FIRGeoPoint* MakeFIRGeoPoint(const GeoPoint& geo_point) {
|
|
return [[FIRGeoPoint alloc] initWithLatitude:geo_point.latitude()
|
|
longitude:geo_point.longitude()];
|
|
}
|
|
|
|
} // namespace api
|
|
} // namespace firestore
|
|
} // namespace firebase
|
|
|
|
NS_ASSUME_NONNULL_END
|