• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef PROTOBUF_COMPILER_HBP_GEN_REPEATED_FIELDS_H_
9 #define PROTOBUF_COMPILER_HBP_GEN_REPEATED_FIELDS_H_
10 
11 #include "absl/strings/string_view.h"
12 #include "google/protobuf/descriptor.h"
13 #include "google/protobuf/compiler/hpb/output.h"
14 
15 namespace google::protobuf::hpb_generator {
16 
17 namespace protobuf = ::proto2;
18 
19 void WriteRepeatedFieldUsingAccessors(const protobuf::FieldDescriptor* field,
20                                       absl::string_view class_name,
21                                       absl::string_view resolved_field_name,
22                                       Output& output, bool read_only);
23 
24 void WriteRepeatedFieldsInMessageHeader(const protobuf::Descriptor* desc,
25                                         const protobuf::FieldDescriptor* field,
26                                         absl::string_view resolved_field_name,
27                                         absl::string_view resolved_upbc_name,
28                                         Output& output);
29 
30 void WriteRepeatedMessageAccessor(const protobuf::Descriptor* message,
31                                   const protobuf::FieldDescriptor* field,
32                                   absl::string_view resolved_field_name,
33                                   absl::string_view class_name, Output& output);
34 
35 void WriteRepeatedStringAccessor(const protobuf::Descriptor* message,
36                                  const protobuf::FieldDescriptor* field,
37                                  absl::string_view resolved_field_name,
38                                  absl::string_view class_name, Output& output);
39 
40 void WriteRepeatedScalarAccessor(const protobuf::Descriptor* message,
41                                  const protobuf::FieldDescriptor* field,
42                                  absl::string_view resolved_field_name,
43                                  absl::string_view class_name, Output& output);
44 
45 }  // namespace protobuf
46 }  // namespace google::hpb_generator
47 
48 #endif  // PROTOBUF_COMPILER_HBP_GEN_REPEATED_FIELDS_H_
49