Skip to content

Commit ce5aa57

Browse files
authored
Format Firestore source code with clang-format (#477)
1 parent a0e851c commit ce5aa57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+192
-149
lines changed

firestore/.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ AllowAllParametersOfDeclarationOnNextLine: true
66
SpacesInContainerLiterals: true
77
DerivePointerAlignment: false
88
PointerAlignment: Left
9-
AllowShortFunctionsOnASingleLine: None
109
IncludeBlocks: Preserve

firestore/src/android/blob_android.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void BlobInternal::Initialize(jni::Loader& loader) {
3434

3535
Class BlobInternal::GetClass() { return Class(g_class); }
3636

37-
Local<BlobInternal> BlobInternal::Create(Env& env, const uint8_t* value,
37+
Local<BlobInternal> BlobInternal::Create(Env& env,
38+
const uint8_t* value,
3839
size_t size) {
3940
Local<Array<uint8_t>> byte_array = env.NewArray<uint8_t>(size);
4041
env.SetArrayRegion(byte_array, 0, size, value);

firestore/src/android/blob_android.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class BlobInternal : public jni::Object {
1515

1616
static jni::Class GetClass();
1717

18-
static jni::Local<BlobInternal> Create(jni::Env& env, const uint8_t* value,
18+
static jni::Local<BlobInternal> Create(jni::Env& env,
19+
const uint8_t* value,
1920
size_t size);
2021

2122
jni::Local<jni::Array<uint8_t>> ToBytes(jni::Env& env) const;

firestore/src/android/converter_android.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ struct ConverterImpl {
3232
}
3333

3434
template <typename PublicT, typename InternalT = InternalType<PublicT>>
35-
static PublicT MakePublicFromJava(jni::Env& env, FirestoreInternal* firestore,
35+
static PublicT MakePublicFromJava(jni::Env& env,
36+
FirestoreInternal* firestore,
3637
const jni::Object& object) {
3738
if (!env.ok() || !object) return {};
3839

@@ -62,7 +63,8 @@ PublicT MakePublic(jni::Env& env, const jni::Object& object) {
6263
}
6364

6465
template <typename PublicT, typename InternalT = InternalType<PublicT>>
65-
PublicT MakePublic(jni::Env& env, FirestoreInternal* firestore,
66+
PublicT MakePublic(jni::Env& env,
67+
FirestoreInternal* firestore,
6668
const jni::Object& object) {
6769
return ConverterImpl::MakePublicFromJava<PublicT, InternalT>(env, firestore,
6870
object);

firestore/src/android/document_reference_android.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ ListenerRegistration DocumentReferenceInternal::AddSnapshotListener(
176176
#endif // defined(FIREBASE_USE_STD_FUNCTION)
177177

178178
ListenerRegistration DocumentReferenceInternal::AddSnapshotListener(
179-
MetadataChanges metadata_changes, EventListener<DocumentSnapshot>* listener,
179+
MetadataChanges metadata_changes,
180+
EventListener<DocumentSnapshot>* listener,
180181
bool passing_listener_ownership) {
181182
Env env = GetEnv();
182183
Local<Object> java_metadata =

firestore/src/android/exception_android.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ std::string ExceptionInternal::ToString(Env& env, const Object& exception) {
9898
return exception.CastTo<Throwable>().GetMessage(env);
9999
}
100100

101-
Local<Throwable> ExceptionInternal::Create(Env& env, Error code,
101+
Local<Throwable> ExceptionInternal::Create(Env& env,
102+
Error code,
102103
const std::string& message) {
103104
if (code == Error::kErrorOk) {
104105
return {};

firestore/src/android/exception_android.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class ExceptionInternal {
2121
static Error GetErrorCode(jni::Env& env, const jni::Object& exception);
2222
static std::string ToString(jni::Env& env, const jni::Object& exception);
2323

24-
static jni::Local<jni::Throwable> Create(jni::Env& env, Error code,
24+
static jni::Local<jni::Throwable> Create(jni::Env& env,
25+
Error code,
2526
const std::string& message);
2627
static jni::Local<jni::Throwable> Wrap(
2728
jni::Env& env, jni::Local<jni::Throwable>&& exception);

firestore/src/android/field_value_android.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ FieldValue FieldValueInternal::Create(Env& env, const Object& object) {
7171
return FieldValue(new FieldValueInternal(Type::kNull, object));
7272
}
7373

74-
FieldValue FieldValueInternal::Create(Env& env, Type type,
74+
FieldValue FieldValueInternal::Create(Env& env,
75+
Type type,
7576
const Object& object) {
7677
if (!env.ok() || !object) return {};
7778
return FieldValue(new FieldValueInternal(type, object));

firestore/src/android/firestore_android.h

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,17 @@ class FirestoreInternal {
6565
explicit FirestoreInternal(App* app);
6666
~FirestoreInternal();
6767

68-
App* app() const {
69-
return app_;
70-
}
68+
App* app() const { return app_; }
7169

7270
// Whether this object was successfully initialized by the constructor.
73-
bool initialized() const {
74-
return app_ != nullptr;
75-
}
71+
bool initialized() const { return app_ != nullptr; }
7672

7773
// Manages all Future objects returned from Firestore API.
78-
FutureManager& future_manager() {
79-
return future_manager_;
80-
}
74+
FutureManager& future_manager() { return future_manager_; }
8175

8276
// When this is deleted, it will clean up all DatabaseReferences,
8377
// DataSnapshots, and other such objects.
84-
CleanupNotifier& cleanup() {
85-
return cleanup_;
86-
}
78+
CleanupNotifier& cleanup() { return cleanup_; }
8779

8880
// Returns a CollectionReference that refers to the specific path.
8981
CollectionReference Collection(const char* collection_path) const;
@@ -159,12 +151,8 @@ class FirestoreInternal {
159151
firestore_public_ = firestore_public;
160152
}
161153

162-
Firestore* firestore_public() {
163-
return firestore_public_;
164-
}
165-
const Firestore* firestore_public() const {
166-
return firestore_public_;
167-
}
154+
Firestore* firestore_public() { return firestore_public_; }
155+
const Firestore* firestore_public() const { return firestore_public_; }
168156

169157
/**
170158
* Finds the FirestoreInternal instance for the given Java Firestore instance.

firestore/src/android/lambda_event_listener.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class LambdaEventListener : public EventListener<T> {
2424
FIREBASE_ASSERT(callback_);
2525
}
2626

27-
void OnEvent(const T& value, Error error_code,
27+
void OnEvent(const T& value,
28+
Error error_code,
2829
const std::string& error_message) override {
2930
callback_(value, error_code, error_message);
3031
}

0 commit comments

Comments
 (0)