aggregation_result.nanopb.cc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright 2024 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* Automatically generated nanopb constant definitions */
  17. /* Generated by nanopb-0.3.9.8 */
  18. #include "aggregation_result.nanopb.h"
  19. #include "Firestore/core/src/nanopb/pretty_printing.h"
  20. namespace firebase {
  21. namespace firestore {
  22. using nanopb::PrintEnumField;
  23. using nanopb::PrintHeader;
  24. using nanopb::PrintMessageField;
  25. using nanopb::PrintPrimitiveField;
  26. using nanopb::PrintTail;
  27. /* @@protoc_insertion_point(includes) */
  28. #if PB_PROTO_HEADER_VERSION != 30
  29. #error Regenerate this file with the current version of nanopb generator.
  30. #endif
  31. const pb_field_t google_firestore_v1_AggregationResult_fields[2] = {
  32. PB_FIELD( 2, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_AggregationResult, aggregate_fields, aggregate_fields, &google_firestore_v1_AggregationResult_AggregateFieldsEntry_fields),
  33. PB_LAST_FIELD
  34. };
  35. const pb_field_t google_firestore_v1_AggregationResult_AggregateFieldsEntry_fields[3] = {
  36. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_AggregationResult_AggregateFieldsEntry, key, key, 0),
  37. PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_AggregationResult_AggregateFieldsEntry, value, key, &google_firestore_v1_Value_fields),
  38. PB_LAST_FIELD
  39. };
  40. /* Check that field information fits in pb_field_t */
  41. #if !defined(PB_FIELD_32BIT)
  42. /* If you get an error here, it means that you need to define PB_FIELD_32BIT
  43. * compile-time option. You can do that in pb.h or on compiler command line.
  44. *
  45. * The reason you need to do this is that some of your messages contain tag
  46. * numbers or field sizes that are larger than what can fit in 8 or 16 bit
  47. * field descriptors.
  48. */
  49. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_AggregationResult_AggregateFieldsEntry, value) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_AggregationResult_google_firestore_v1_AggregationResult_AggregateFieldsEntry)
  50. #endif
  51. #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
  52. /* If you get an error here, it means that you need to define PB_FIELD_16BIT
  53. * compile-time option. You can do that in pb.h or on compiler command line.
  54. *
  55. * The reason you need to do this is that some of your messages contain tag
  56. * numbers or field sizes that are larger than what can fit in the default
  57. * 8 bit descriptors.
  58. */
  59. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_AggregationResult_AggregateFieldsEntry, value) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_AggregationResult_google_firestore_v1_AggregationResult_AggregateFieldsEntry)
  60. #endif
  61. std::string google_firestore_v1_AggregationResult::ToString(int indent) const {
  62. std::string tostring_header = PrintHeader(indent, "AggregationResult", this);
  63. std::string tostring_result;
  64. for (pb_size_t i = 0; i != aggregate_fields_count; ++i) {
  65. tostring_result += PrintMessageField("aggregate_fields ",
  66. aggregate_fields[i], indent + 1, true);
  67. }
  68. bool is_root = indent == 0;
  69. if (!tostring_result.empty() || is_root) {
  70. std::string tostring_tail = PrintTail(indent);
  71. return tostring_header + tostring_result + tostring_tail;
  72. } else {
  73. return "";
  74. }
  75. }
  76. std::string google_firestore_v1_AggregationResult_AggregateFieldsEntry::ToString(int indent) const {
  77. std::string tostring_header = PrintHeader(indent, "AggregateFieldsEntry", this);
  78. std::string tostring_result;
  79. tostring_result += PrintPrimitiveField("key: ", key, indent + 1, false);
  80. tostring_result += PrintMessageField("value ", value, indent + 1, false);
  81. std::string tostring_tail = PrintTail(indent);
  82. return tostring_header + tostring_result + tostring_tail;
  83. }
  84. } // namespace firestore
  85. } // namespace firebase
  86. /* @@protoc_insertion_point(eof) */