timestamp.nanopb.cc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2023 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 "timestamp.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_protobuf_Timestamp_fields[3] = {
  32. PB_FIELD( 1, INT64 , SINGULAR, STATIC , FIRST, google_protobuf_Timestamp, seconds, seconds, 0),
  33. PB_FIELD( 2, INT32 , SINGULAR, STATIC , OTHER, google_protobuf_Timestamp, nanos, seconds, 0),
  34. PB_LAST_FIELD
  35. };
  36. std::string google_protobuf_Timestamp::ToString(int indent) const {
  37. std::string tostring_header = PrintHeader(indent, "Timestamp", this);
  38. std::string tostring_result;
  39. tostring_result += PrintPrimitiveField("seconds: ",
  40. seconds, indent + 1, false);
  41. tostring_result += PrintPrimitiveField("nanos: ",
  42. nanos, indent + 1, false);
  43. bool is_root = indent == 0;
  44. if (!tostring_result.empty() || is_root) {
  45. std::string tostring_tail = PrintTail(indent);
  46. return tostring_header + tostring_result + tostring_tail;
  47. } else {
  48. return "";
  49. }
  50. }
  51. } // namespace firestore
  52. } // namespace firebase
  53. /* @@protoc_insertion_point(eof) */