|
|
@ -15,14 +15,15 @@ |
|
|
|
#include "absl/strings/ascii.h" |
|
|
|
#include "absl/strings/ascii.h" |
|
|
|
#include "absl/strings/str_cat.h" |
|
|
|
#include "absl/strings/str_cat.h" |
|
|
|
#include "absl/strings/string_view.h" |
|
|
|
#include "absl/strings/string_view.h" |
|
|
|
|
|
|
|
#include "google/protobuf/descriptor.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_accessors.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_accessors.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_enums.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_enums.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_extensions.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_extensions.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_utils.h" |
|
|
|
#include "google/protobuf/compiler/hpb/gen_utils.h" |
|
|
|
#include "google/protobuf/compiler/hpb/names.h" |
|
|
|
#include "google/protobuf/compiler/hpb/names.h" |
|
|
|
#include "google/protobuf/compiler/hpb/output.h" |
|
|
|
#include "google/protobuf/compiler/hpb/output.h" |
|
|
|
#include "google/protobuf/descriptor.h" |
|
|
|
|
|
|
|
#include "upb_generator/common.h" |
|
|
|
#include "upb_generator/common.h" |
|
|
|
|
|
|
|
#include "upb_generator/file_layout.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace google::protobuf::hpb_generator { |
|
|
|
namespace google::protobuf::hpb_generator { |
|
|
|
|
|
|
|
|
|
|
@ -47,6 +48,10 @@ void WriteInternalForwardDeclarationsInHeader( |
|
|
|
const protobuf::Descriptor* message, Output& output); |
|
|
|
const protobuf::Descriptor* message, Output& output); |
|
|
|
void WriteDefaultInstanceHeader(const protobuf::Descriptor* message, |
|
|
|
void WriteDefaultInstanceHeader(const protobuf::Descriptor* message, |
|
|
|
Output& output); |
|
|
|
Output& output); |
|
|
|
|
|
|
|
void WriteExtensionIdentifiersImplementation( |
|
|
|
|
|
|
|
const protobuf::Descriptor* message, |
|
|
|
|
|
|
|
const std::vector<const protobuf::FieldDescriptor*>& file_exts, |
|
|
|
|
|
|
|
Output& output); |
|
|
|
void WriteUsingEnumsInHeader( |
|
|
|
void WriteUsingEnumsInHeader( |
|
|
|
const protobuf::Descriptor* message, |
|
|
|
const protobuf::Descriptor* message, |
|
|
|
const std::vector<const protobuf::EnumDescriptor*>& file_enums, |
|
|
|
const std::vector<const protobuf::EnumDescriptor*>& file_enums, |
|
|
@ -451,6 +456,8 @@ void WriteMessageImplementation( |
|
|
|
} |
|
|
|
} |
|
|
|
)cc", |
|
|
|
)cc", |
|
|
|
ClassName(descriptor)); |
|
|
|
ClassName(descriptor)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteExtensionIdentifiersImplementation(descriptor, file_exts, output); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -478,6 +485,18 @@ void WriteExtensionIdentifiersInClassHeader( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WriteExtensionIdentifiersImplementation( |
|
|
|
|
|
|
|
const protobuf::Descriptor* message, |
|
|
|
|
|
|
|
const std::vector<const protobuf::FieldDescriptor*>& file_exts, |
|
|
|
|
|
|
|
Output& output) { |
|
|
|
|
|
|
|
for (auto* ext : file_exts) { |
|
|
|
|
|
|
|
if (ext->extension_scope() && |
|
|
|
|
|
|
|
ext->extension_scope()->full_name() == message->full_name()) { |
|
|
|
|
|
|
|
WriteExtensionIdentifier(ext, output); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WriteUsingEnumsInHeader( |
|
|
|
void WriteUsingEnumsInHeader( |
|
|
|
const protobuf::Descriptor* message, |
|
|
|
const protobuf::Descriptor* message, |
|
|
|
const std::vector<const protobuf::EnumDescriptor*>& file_enums, |
|
|
|
const std::vector<const protobuf::EnumDescriptor*>& file_enums, |
|
|
|