|
1 | 1 | /*
|
2 |
| - * Copyright 2019 Google |
| 2 | + * Copyright 2019 Google LLC |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -#include "Firestore/core/src/core/key_field_in_filter.h" |
18 | 17 | #include "Firestore/core/src/core/key_field_not_in_filter.h"
|
| 18 | +#include "Firestore/core/src/core/key_field_in_filter.h" |
19 | 19 |
|
20 | 20 | #include <memory>
|
21 | 21 | #include <utility>
|
|
25 | 25 | #include "absl/algorithm/container.h"
|
26 | 26 |
|
27 | 27 | namespace firebase {
|
28 |
| - namespace firestore { |
29 |
| - namespace core { |
| 28 | +namespace firestore { |
| 29 | +namespace core { |
30 | 30 |
|
31 |
| - using model::Document; |
32 |
| - using model::DocumentKey; |
33 |
| - using model::FieldPath; |
34 |
| - using model::FieldValue; |
| 31 | +using model::Document; |
| 32 | +using model::DocumentKey; |
| 33 | +using model::FieldPath; |
| 34 | +using model::FieldValue; |
35 | 35 |
|
36 |
| - using Operator = Filter::Operator; |
| 36 | +using Operator = Filter::Operator; |
37 | 37 |
|
38 |
| - class KeyFieldNotInFilter::Rep : public FieldFilter::Rep { |
39 |
| - public: |
40 |
| - Rep(FieldPath field, FieldValue value) |
41 |
| - : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { |
42 |
| - KeyFieldInFilter::ValidateArrayValue(this->value()); |
43 |
| - } |
| 38 | +class KeyFieldNotInFilter::Rep : public FieldFilter::Rep { |
| 39 | + public: |
| 40 | + Rep(FieldPath field, FieldValue value) |
| 41 | + : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { |
| 42 | + KeyFieldInFilter::ValidateArrayValue(this->value()); |
| 43 | + } |
44 | 44 |
|
45 |
| - Type type() const override { |
46 |
| - return Type::kKeyFieldInFilter; |
47 |
| - } |
| 45 | + Type type() const override { |
| 46 | + return Type::kKeyFieldInFilter; |
| 47 | + } |
48 | 48 |
|
49 |
| - bool Matches(const model::Document& doc) const override; |
50 |
| - }; |
| 49 | + bool Matches(const model::Document& doc) const override; |
| 50 | +}; |
51 | 51 |
|
52 |
| - KeyFieldNotInFilter::KeyFieldNotInFilter(FieldPath field, FieldValue value) |
53 |
| - : FieldFilter( |
54 |
| - std::make_shared<const Rep>(std::move(field), std::move(value))) { |
55 |
| - } |
| 52 | +KeyFieldNotInFilter::KeyFieldNotInFilter(FieldPath field, FieldValue value) |
| 53 | + : FieldFilter( |
| 54 | + std::make_shared<const Rep>(std::move(field), std::move(value))) { |
| 55 | +} |
56 | 56 |
|
57 |
| - bool KeyFieldNotInFilter::Rep::Matches(const Document& doc) const { |
58 |
| - const FieldValue::Array& array_value = value().array_value(); |
59 |
| - return !KeyFieldInFilter::Contains(array_value, doc); |
60 |
| - } |
| 57 | +bool KeyFieldNotInFilter::Rep::Matches(const Document& doc) const { |
| 58 | + const FieldValue::Array& array_value = value().array_value(); |
| 59 | + return !KeyFieldInFilter::Contains(array_value, doc); |
| 60 | +} |
61 | 61 |
|
62 |
| - } // namespace core |
63 |
| - } // namespace firestore |
| 62 | +} // namespace core |
| 63 | +} // namespace firestore |
64 | 64 | } // namespace firebase
|
0 commit comments