Commit Graph
11 Commits
Author SHA1 Message Date
Gil cd460eca2d Rationalize input validation exceptions and assertion failures (#4107)
* Rationalize input validation exceptions and assertions

... under a single ThrowHandler concept. This makes it possible to set
an alternative ThrowHandler in our C# bindings that properly translates
input validation exceptions to the correct .NET exception types.

* Rename api/input_validation.h to util/exception.h

* Reimplement util/hard_assert.h in terms of util/exception.h
2019-10-18 12:58:45 -07:00
Gil de7eb4f2e0 Migrate FSTServerTimestampValue to FSTDelegateValue (#3174)
* Migrate FSTServerTimetsampValue to FSTDelegateValue

* Make ServerTimestamp use FSTFieldValue for previous value

This makes it possible integrate the FSTServerTimestampValue changes
earlier.
2019-06-13 22:07:45 -07:00
Michael Lehenbauer db2701b480 Take 2: Move input validation logic from FIRFieldPath to model::FieldPath. (#2727) (#2790)
* Move input validation logic from FIRFieldPath to model::FieldPath. (#2727)
2019-04-11 14:44:11 -07:00
Michael Lehenbauer 7e6cc0ddd5 Revert "Move input validation logic from FIRFieldPath to model::FieldPath. (#2727)" (#2789)
This reverts commit 384ccd81a9 due to broken integration tests.
2019-04-09 15:59:06 -07:00
Michael Lehenbauer 384ccd81a9 Move input validation logic from FIRFieldPath to model::FieldPath. (#2727)
This will allow it to be shared with the (eventual) C++ FieldPath Public API.
2019-04-09 13:27:00 -07:00
Gil 2e8b9181fa Port FSTUsageValidation to C++ (#2670)
* Port FSTUsageValidation to C++

* Add an error log level
2019-03-28 13:19:28 -07:00
Gil fb0ba40c00 Remove extraneous braces (#1315) 2018-05-22 16:39:45 -07:00
Gil 04a28fce81 Make BasePath hash directly as a range (#1232)
Remove BasePath.Hash() Objective-C compatibility method
Make DocumentKey's hasher use BasePath's segment-based hash code.
2018-05-06 14:12:20 -07:00
Gil 0a66187053 Add lint checking for Objective-C++ sources (#1048)
* 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
2018-04-09 11:54:39 -07:00
zxu 9e815620e9 grand PR to port the remaining paths (FieldPath and ResourcePath). (#865)
* 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
2018-03-14 08:57:31 -04:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* Move all Firestore files to Objective-C++
* Update project file references
* Don't use module imports from Objective-C++
* Use extern "C" for C-accessible globals
* Work around more stringent type checking in Objective-C++
  * NSMutableDictionary ivars aren't implicitly casted to NSDictionary
  * FSTMaybeDocument callback can't be passed a function that accepts
    FSTDocument
  * NSComparisonResult can't be multiplied by -1 without casting
* Add a #include <inttypes.h> where needed
* Avoid using C++ keywords as variables
* Remove #if __cplusplus guards
2018-01-31 11:23:55 -08:00