aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/model
Commit message (Collapse)AuthorAge
* Eliminate unnecessary DocumentKey->FSTDocumentKey conversions (#1507)Gravatar Konstantin Varlamov2018-07-10
|
* Add a HARD_ASSERT C++ assertion macro (#1304)Gravatar Gil2018-05-22
| | | | | | * Add HARD_ASSERT * Use HARD_ASSERT * Remove FIREBASE_ASSERT * Remove StringPrintf
* Add missing tests to the Firestore project (#1254)Gravatar Gil2018-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix order of project elements * Add immutable container tests to the Firestore project * Fix style problems in TransformOperations * Method names should have an initial upper case character (except getters/setters) * Pointers bind to the type not the name in C++ * Fix unsigned/signed comparison warning * Make transform_operations.h Objective-C++ only It turns out that you can't conditionally define virtual methods. This causes multiple versions of the vtable to be emitted and when the linker resolves all the vtable definitions for a class it picks one arbitrarily causing failures for callers that expect some of the conditional methods to be present. * Add precondition_test and field_mask_test to the project * Add field_transform_test and transform_operations_test to the project * Clean up missing newline/excess comments * Use braced initialization to avoid linter false positive on std::transform
* Remove final vestiges of FSTSnapshotVersion (#1253)Gravatar Gil2018-05-09
|
* Backport array contains / transform improvements from Web. (#1242)Gravatar Michael Lehenbauer2018-05-08
|
* Make BasePath hash directly as a range (#1232)Gravatar Gil2018-05-06
| | | | | Remove BasePath.Hash() Objective-C compatibility method Make DocumentKey's hasher use BasePath's segment-based hash code.
* Migrate FSTDocumentVersionDictionary to C++ DocumentVersionMap (#1231)Gravatar Gil2018-05-05
|
* Port FSTDocumentKeySet to C++ DocumentKeySet (#1229)Gravatar Gil2018-05-05
| | | | | | | | | * Define a Comparator for DocumentKey * Automated migration from FSTDocumentKeySet to DocumentKeySet * Manual fixups for DocumentKeySet * Delete FSTDocumentKeySet
* Add Immutable SortedSet in C++ (#1206)Gravatar Gil2018-05-02
| | | | | | | * Add SortedSet * Add document_key_set.h * Add equality to SortedSet
* Adding mergeFields support (#1141)Gravatar Sebastian Schmidt2018-05-02
|
* Port `SnapshotVersion` for the rest Firestore modulo (#1185)Gravatar zxu2018-05-01
| | | | | | | | | | | | | | * remove conversions in `Local` and `Remote` * replace `FSTSnapshotVersion` in `Model` * replace `FSTSnapshotVersion` in the rest * let test check equal with C++ equal * fix newly added code * address changes
* Define a general hashing utility in C++ (#1195)Gravatar Gil2018-05-01
| | | | | This is good enough to make it possible for the new C++ code to interoperate with existing Objective-C code where `-hash` is required if you override `-isEqual:`.
* Port `SnapshotVersion` for `Local` (#1182)Gravatar zxu2018-04-25
| | | | | | | | | | | | * no-brainer replace `FSTSnapshotVersion` with `SnapshotVersion` * refresh code * fix LocalStore * fix LocalStore (partial revert 78e6c38) * address changes
* fix a bug caught by asan failure (#1173)Gravatar zxu2018-04-24
|
* Update `FieldValue` For Porting `Mutation`s to C++ (#1144)Gravatar zxu2018-04-23
| | | | | | | | | | * update FieldValue for Mutation implementation * address changes * address changes * address change
* Serialize array transform mutations. (#1107)Gravatar Michael Lehenbauer2018-04-17
| | | | * Serialize array transform mutations. * Improve ArrayTransform constructor to avoid extra copying.
* Implement local and server application of arrayUnion and arrayRemove ↵Gravatar Michael Lehenbauer2018-04-16
| | | | transforms. (#1101)
* Array Transforms public API and parsingGravatar Michael Lehenbauer2018-04-13
| | | | | This includes the new FIRFieldValue sentinels, the FSTUserDataConverter code to parse them into internal ArrayTransform operations for use in an FSTTransformMutation, and some sanity testing in FSTMutationTests. I still need to implement FSTTransformMutation support for local application and serialization (and then integration tests).
* Port `Precondition` to C++ (#1040)Gravatar zxu2018-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++ * address changes * address changes * address changes * implement `FieldTransform` in C++ * port `FieldTransform` * make `fieldTransforms` shared inside `context` * Implement Precondition in C++ w/o test yet * add unit test for `Precondition` * port `Precondition` * address changes * address changes * fix bugs for integration test * address changes * fix lint * address changes * address changes
* Add clang-tidy checks for Firestore (#1078)Gravatar Gil2018-04-12
| | | | | | | | | | | | | | | | | | | | * Add a .clang-tidy configuration for Firestore C++ * Fix clang-tidy warnings * typedef -> using * const ref + rvalue ref -> pass by value * NULL -> nullptr * remove useless default initializations * remove useless const value-type parameter declarations (definitions can still use them) * use auto instead of repeating types in a cast * Fix typos * Address use of static method through instance warnings * Address use after move warnings
* Port FieldTransform to C++ (#1033)Gravatar zxu2018-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++ * address changes * address changes * address changes * implement `FieldTransform` in C++ * port `FieldTransform` * make `fieldTransforms` shared inside `context` * address changes * fix lint * address changes
* Add lint checking for Objective-C++ sources (#1048)Gravatar Gil2018-04-09
| | | | | | | | | | | | | | | | * lint.sh now lints Objective-C++ too * cpplint checks system-style includes that should be user-style This prevents it from recognizing project sources as if they were C system headers and then complaining that they're in the wrong place. * cpplint checks #imports and #includes * cpplint checks that C++ system headers aren't #imported * cpplint checks for C system headers that could be C++ system headers * cpplint checks that Objective-C sources include their headers
* Port transform operations to C++ (#1020)Gravatar zxu2018-04-05
| | | | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * Port transform operations (FSTTransformOperation, FSTServerTimestampTransform) to C++ * address changes * address changes * address changes * address change
* port FieldMask to C++ (#998)Gravatar zxu2018-04-04
| | | | | | | | | | | | | | | | | | | | * port FieldMask to C++ * address changes * address changes * fix test * address change * fix lint * address changes * Revert "address changes" This reverts commit c75bb42851b785ab0838bb23679f87dfad9df4bb.
* Add ObjectValue::Map alias (#967)Gravatar rsgowman2018-03-27
|
* port C++ DocumentKey to the rest of Firestore code (#977)Gravatar zxu2018-03-27
| | | | | | | | | | * port C++ DocumentKey to API's and Core's * address changes * address changes * fix Hash return types
* C++ migration: make Timestamp class a part of public API (#944)Gravatar Konstantin Varlamov2018-03-27
| | | | | | | | | | | * move Timestamp from model/ to the root directory; * move Timestamp to top-level firebase namespace and update all references; * add conversions to and from native date types; * add a specialization of std::hash; * add comments to public member functions; * rename nanos -> nanoseconds; * add public headers, including Timestamp, to CMake; * increase test coverage.
* Port FSTLevelDBKey to C++ (#937)Gravatar Gil2018-03-21
|
* port `DocumentKey` to non-container types of `Model/*` (#930)Gravatar zxu2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * naively remove FSTPath import and source/test files. * port FieldPath, part I * port FieldPath, part II * port ResourcePath, part I * port ResourcePath, part II * the grand commit to fix build errors * use testutil:: helper instead of those from FSTHelpers * fix test and lint * use c_str in errmsg directly * fix * fix * make code clean * fix integration test I missed * fix to avoid naming collision in preprocessor * address changes * address changes * address changes * fix: fieldMask are actually shared with different context. * address changes * add converter function between two DocumentKey implementations * add unit test * address changes * fix lint * using DocumentKey in model except for the container types `FSTDocumentDictionary`, `FSTDocumentKeySet`, and `FSTDocumentVersionDictionary` * change other place w.r.t. the use of `DocumentKey` in model * update parameter of test helpers from NSString to string_view * revert a temporary change used in debug * address changes
* Move core/types.h to model to prevent a core -> local -> core dependency ↵Gravatar Gil2018-03-15
| | | | cycle (#929)
* adding converters between DocumentKey (#900)Gravatar zxu2018-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * naively remove FSTPath import and source/test files. * port FieldPath, part I * port FieldPath, part II * port ResourcePath, part I * port ResourcePath, part II * the grand commit to fix build errors * use testutil:: helper instead of those from FSTHelpers * fix test and lint * use c_str in errmsg directly * fix * fix * make code clean * fix integration test I missed * fix to avoid naming collision in preprocessor * address changes * address changes * address changes * fix: fieldMask are actually shared with different context. * address changes * add converter function between two DocumentKey implementations * add unit test * address changes * fix lint
* grand PR to port the remaining paths (FieldPath and ResourcePath). (#865)Gravatar zxu2018-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * naively remove FSTPath import and source/test files. * port FieldPath, part I * port FieldPath, part II * port ResourcePath, part I * port ResourcePath, part II * the grand commit to fix build errors * use testutil:: helper instead of those from FSTHelpers * fix test and lint * use c_str in errmsg directly * fix * fix * make code clean * fix integration test I missed * fix to avoid naming collision in preprocessor * address changes * address changes * address changes * fix: fieldMask are actually shared with different context. * address changes * address changes
* [De]Serialize FieldValue map_values ("Objects") (#878)Gravatar rsgowman2018-03-08
| | | These can (recursively) contain other FieldValues.
* port paths to FSTDocumentKey (#877)Gravatar zxu2018-03-06
| | | | | | | | * replace path with C++ implementation in FSTDocumentKey.{h,mm} only * address changes * address changes
* add converters and port paths to FSTQuery (#869)Gravatar zxu2018-03-05
| | | | | | | | | | * add converters and fix FSTQuery.{h,m} only * address changes * a change forget to address * add a dummy function to make inline-only-library buildable
* Serialize (and deserialize) string values (#864)Gravatar rsgowman2018-02-28
|
* Add FieldValue.boolean_value() (#862)Gravatar rsgowman2018-02-27
|
* Avoid wrapping and rewrapping NSStrings when constructing DatabaseId (#833)Gravatar Gil2018-02-22
| | | | | | * Avoid wrapping and rewrapping NSStrings when constructing DatabaseId * Shorten DatabaseId::kDefaultDatabaseId
* Serialize (and deserialize) int64 values (#818) (#829)Gravatar rsgowman2018-02-22
|
* Port Firestore Document to C++ (#777)Gravatar zxu2018-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement SnapshotVersion and test * update project * implement MaybeDocument and test * move snapshot-version from core to model * fix a bug * implement Document and test * implement NoDocument * adding type tag and fix style * fix a few bugs, discovered after merging and test run. * add assert to check FieldValue type and more test for comparision. * address changes * allow moving FieldValue to construct Document. * address changes * add document tests to project * use std::less convention * make Type::Unknown static initializer
* Update FieldValue of type Reference (#775)Gravatar zxu2018-02-12
| | | | | | | | | | * update FieldValue of type Reference * address change * fix bad path string literal in test * use ReferenceValue and qualified name
* C++ port: add C++ equivalent of FSTDocumentKey. (#762)Gravatar Konstantin Varlamov2018-02-09
| | | | | Also move kDocumentKeyPath to the only point of usage - make it a static member variable of FieldPath.
* port Firestore SnapshotVersion in C++ (#767)Gravatar zxu2018-02-09
| | | * implement SnapshotVersion and test
* cmake build fixes (#770)Gravatar rsgowman2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix nanopb (in cmake build) Look for binaries in the src dir (since that's where we build now.) This error would be masked if a previous build had completed prior to switching nanopb to build out of src. Also, don't patch the protoc path multiple times. This could be triggered by (eg) 'make && make clean && make'. * Add resource_path.{h,cc} to the cmake build * Fix signed/unsigned int comparison warnings * Ensure FieldValue tag_ is initialized during cp/mv ctor. Otherwise, the assignment operator attempts to deallocate based on the (uninitialized) tag_ variable, posssibly leading to segfaults. * Fix tests that throw exceptions. The (previous) tests checked to ensure that an abort() occurs, but if ABSL_HAVE_EXCEPTIONS is defined on non-macos (which is currently the default) then the assertions will throw a std::logic_error rather than abort()ing. On macos, an exception is thrown too, but the exception doesn't derrive from std::exception, so ASSERT_DEATH_* doesn't catch it (hence why ASSERT_DEATH_* actually works.) To resolve this, I've switched to ASSERT_ANY_THROW.
* Explicitly specify the default constructor to FieldPath (#773)Gravatar Gil2018-02-08
| | | | | | | | | | | Xcode prior to 8.3 does not accept an explicitly defaulted constructor (`= default`) for the purposes of default initializing a const object. This fixes a build failure under Xcode 8.2: ``` Firestore/core/src/firebase/firestore/model/field_path.cc:144:26: error: default initialization of an object of const type 'const firebase::firestore::model::FieldPath' without a user-provided default constructor static const FieldPath empty_path; ```
* C++ port: port FSTFieldPath and FSTResourcePath to C++ (#749)Gravatar Konstantin Varlamov2018-02-06
| | | Similar to Objective-C, FieldPath and ResourcePath share most of their interface (and implementation) by deriving from BasePath (using CRTP, so that factory methods in BasePath can return an instance of the derived class).
* Implement Firestore DatabaseInfo and port both Database{Id,Info} C++ to the ↵Gravatar zxu2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iOS code (#738) * implement Firestore DatabaseInfo in C++ * temporary stash changes; blocking on the massive renaming of .m to .mm * add database_info_test to project * finish port DatabaseId and fix style, modular fixing DatabaseInfo * port DatabaseInfo * remove FSTDatabase{ID,Info} and their tests from project * fix unit test * use namespace alias * use namespace alias, leftover * address more changes * refactoring to use raw pointer instead of value for property * address changes * remove self-> * fix style * remove the name suffix Alloc * fix a bug
* Firestore DatabaseId in C++ (#727)Gravatar zxu2018-01-29
| | | | | | | | | | | | * Implement DataBaseId in C++ * add database_id_test to project * fix project * address changes * fix style
* Use fixed-sized types (#719)Gravatar Gil2018-01-28
| | | Should have caught this during review, but cpplint caught it
* Fix a number of c++ build errors (#715)Gravatar rsgowman2018-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move -fvisibility-inlines-hidden from common_flags to cxx_flags This option isn't supported by C (and causes the build to fail under at least rodete). Manifested error was: ``` -- Looking for include file openssl/rand.h -- Looking for include file openssl/rand.h - not found CMake Error at core/src/firebase/firestore/util/CMakeLists.txt:94 (message): No implementation for SecureRandom available. -- Configuring incomplete, errors occurred! ``` which is completely misleading. :( * Fix exception include for std::logic_error Was causing compiler error on (at least) rodete. (http://en.cppreference.com/w/cpp/error/logic_error suggests that stdexcept is the correct header.) * Remove 'const' from vector contents. vectors cannot contain const objects as the contained objects are required to be assignable and copy constructable. (Not *quite* strictly true; since c++11, this requirement now depends on the operations performed on the container. But my compiler objects at any rate.) http://en.cppreference.com/w/cpp/container/vector https://stackoverflow.com/questions/8685257/why-cant-you-put-a-const-object-into-a-stl-container * Add brackets as suggested (required) by my compiler. * Add missing include For LLONG_MIN, etc. * Enable gnu extension to c++11 for firestore/util *test*. We disable them by default (in cmake/CompilerSetup.cmake) but our tests requires hexidecimal floating point, which is not supported in c++11 (though is supported in C++17, gnu++11, and others). http://en.cppreference.com/w/cpp/language/floating_literal https://bugzilla.redhat.com/show_bug.cgi?id=1321986 * Fix printf format for uint64_t http://en.cppreference.com/w/cpp/types/integer https://stackoverflow.com/questions/9225567/how-to-print-a-int64-t-type-in-c * Allow 0 length printf template strings in tests. * Get rid of a multi line comment. The backslash is apparently interpreted by the compiler cause the next line to be ignored too. In this case, the next line is (currently) a comment, and would be ignored anyways. (But that doesn't stop the compiler from yelling.) * Run ./scripts/style.sh