From e6fa3f9d869765544b8e424e8573fe8d9af35534 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 19 Apr 2016 15:41:33 -0700 Subject: Changed schema for JSON test to be defined in a .proto file. (#54) * Changed schema for JSON test to be defined in a .proto file. Before we had lots of code to build these schemas manually, but this was verbose and made it difficult to add to the schema easily. Now we can just write a .proto file and adding fields is easy. To avoid making the tests depend on upbc (and thus Lua) we check in the generated schema. * Made protobuf-compiler a dependency of "make genfiles." * For genfiles download recent protoc that can handle proto3. * Only use new protoc for genfiles. --- upb/descriptor/descriptor.upbdefs.h | 168 ++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 82 deletions(-) (limited to 'upb/descriptor/descriptor.upbdefs.h') diff --git a/upb/descriptor/descriptor.upbdefs.h b/upb/descriptor/descriptor.upbdefs.h index 6d9b5c4..d8a22ca 100644 --- a/upb/descriptor/descriptor.upbdefs.h +++ b/upb/descriptor/descriptor.upbdefs.h @@ -4,7 +4,11 @@ * actually storing protobufs. It only contains *defs* which * let you reflect over a protobuf *schema*. */ -/* This file was generated by upbc (the upb compiler). +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * upb/descriptor/descriptor.proto + * * Do not edit -- your changes will be discarded when the file is * regenerated. */ @@ -294,347 +298,347 @@ namespace upbdefs { namespace google { namespace protobuf { -class DescriptorProto : public upb::reffed_ptr { +class DescriptorProto : public ::upb::reffed_ptr { public: - DescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + DescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_DescriptorProto_is(m)); } static DescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_get(&m); return DescriptorProto(m, &m); } - class ExtensionRange : public upb::reffed_ptr { + class ExtensionRange : public ::upb::reffed_ptr { public: - ExtensionRange(const upb::MessageDef* m, const void *ref_donor = NULL) + ExtensionRange(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_DescriptorProto_ExtensionRange_is(m)); } static ExtensionRange get() { - const upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_ExtensionRange_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_ExtensionRange_get(&m); return ExtensionRange(m, &m); } }; - class ReservedRange : public upb::reffed_ptr { + class ReservedRange : public ::upb::reffed_ptr { public: - ReservedRange(const upb::MessageDef* m, const void *ref_donor = NULL) + ReservedRange(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_DescriptorProto_ReservedRange_is(m)); } static ReservedRange get() { - const upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_ReservedRange_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_DescriptorProto_ReservedRange_get(&m); return ReservedRange(m, &m); } }; }; -class EnumDescriptorProto : public upb::reffed_ptr { +class EnumDescriptorProto : public ::upb::reffed_ptr { public: - EnumDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + EnumDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_EnumDescriptorProto_is(m)); } static EnumDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_EnumDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_EnumDescriptorProto_get(&m); return EnumDescriptorProto(m, &m); } }; -class EnumOptions : public upb::reffed_ptr { +class EnumOptions : public ::upb::reffed_ptr { public: - EnumOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + EnumOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_EnumOptions_is(m)); } static EnumOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_EnumOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_EnumOptions_get(&m); return EnumOptions(m, &m); } }; -class EnumValueDescriptorProto : public upb::reffed_ptr { +class EnumValueDescriptorProto : public ::upb::reffed_ptr { public: - EnumValueDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + EnumValueDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_EnumValueDescriptorProto_is(m)); } static EnumValueDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_EnumValueDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_EnumValueDescriptorProto_get(&m); return EnumValueDescriptorProto(m, &m); } }; -class EnumValueOptions : public upb::reffed_ptr { +class EnumValueOptions : public ::upb::reffed_ptr { public: - EnumValueOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + EnumValueOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_EnumValueOptions_is(m)); } static EnumValueOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_EnumValueOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_EnumValueOptions_get(&m); return EnumValueOptions(m, &m); } }; -class FieldDescriptorProto : public upb::reffed_ptr { +class FieldDescriptorProto : public ::upb::reffed_ptr { public: - FieldDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + FieldDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_FieldDescriptorProto_is(m)); } static FieldDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_FieldDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_FieldDescriptorProto_get(&m); return FieldDescriptorProto(m, &m); } - class Label : public upb::reffed_ptr { + class Label : public ::upb::reffed_ptr { public: - Label(const upb::EnumDef* e, const void *ref_donor = NULL) + Label(const ::upb::EnumDef* e, const void *ref_donor = NULL) : reffed_ptr(e, ref_donor) { assert(upbdefs_google_protobuf_FieldDescriptorProto_Label_is(e)); } static Label get() { - const upb::EnumDef* e = upbdefs_google_protobuf_FieldDescriptorProto_Label_get(&e); + const ::upb::EnumDef* e = upbdefs_google_protobuf_FieldDescriptorProto_Label_get(&e); return Label(e, &e); } }; - class Type : public upb::reffed_ptr { + class Type : public ::upb::reffed_ptr { public: - Type(const upb::EnumDef* e, const void *ref_donor = NULL) + Type(const ::upb::EnumDef* e, const void *ref_donor = NULL) : reffed_ptr(e, ref_donor) { assert(upbdefs_google_protobuf_FieldDescriptorProto_Type_is(e)); } static Type get() { - const upb::EnumDef* e = upbdefs_google_protobuf_FieldDescriptorProto_Type_get(&e); + const ::upb::EnumDef* e = upbdefs_google_protobuf_FieldDescriptorProto_Type_get(&e); return Type(e, &e); } }; }; -class FieldOptions : public upb::reffed_ptr { +class FieldOptions : public ::upb::reffed_ptr { public: - FieldOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + FieldOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_FieldOptions_is(m)); } static FieldOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_FieldOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_FieldOptions_get(&m); return FieldOptions(m, &m); } - class CType : public upb::reffed_ptr { + class CType : public ::upb::reffed_ptr { public: - CType(const upb::EnumDef* e, const void *ref_donor = NULL) + CType(const ::upb::EnumDef* e, const void *ref_donor = NULL) : reffed_ptr(e, ref_donor) { assert(upbdefs_google_protobuf_FieldOptions_CType_is(e)); } static CType get() { - const upb::EnumDef* e = upbdefs_google_protobuf_FieldOptions_CType_get(&e); + const ::upb::EnumDef* e = upbdefs_google_protobuf_FieldOptions_CType_get(&e); return CType(e, &e); } }; - class JSType : public upb::reffed_ptr { + class JSType : public ::upb::reffed_ptr { public: - JSType(const upb::EnumDef* e, const void *ref_donor = NULL) + JSType(const ::upb::EnumDef* e, const void *ref_donor = NULL) : reffed_ptr(e, ref_donor) { assert(upbdefs_google_protobuf_FieldOptions_JSType_is(e)); } static JSType get() { - const upb::EnumDef* e = upbdefs_google_protobuf_FieldOptions_JSType_get(&e); + const ::upb::EnumDef* e = upbdefs_google_protobuf_FieldOptions_JSType_get(&e); return JSType(e, &e); } }; }; -class FileDescriptorProto : public upb::reffed_ptr { +class FileDescriptorProto : public ::upb::reffed_ptr { public: - FileDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + FileDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_FileDescriptorProto_is(m)); } static FileDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_FileDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_FileDescriptorProto_get(&m); return FileDescriptorProto(m, &m); } }; -class FileDescriptorSet : public upb::reffed_ptr { +class FileDescriptorSet : public ::upb::reffed_ptr { public: - FileDescriptorSet(const upb::MessageDef* m, const void *ref_donor = NULL) + FileDescriptorSet(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_FileDescriptorSet_is(m)); } static FileDescriptorSet get() { - const upb::MessageDef* m = upbdefs_google_protobuf_FileDescriptorSet_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_FileDescriptorSet_get(&m); return FileDescriptorSet(m, &m); } }; -class FileOptions : public upb::reffed_ptr { +class FileOptions : public ::upb::reffed_ptr { public: - FileOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + FileOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_FileOptions_is(m)); } static FileOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_FileOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_FileOptions_get(&m); return FileOptions(m, &m); } - class OptimizeMode : public upb::reffed_ptr { + class OptimizeMode : public ::upb::reffed_ptr { public: - OptimizeMode(const upb::EnumDef* e, const void *ref_donor = NULL) + OptimizeMode(const ::upb::EnumDef* e, const void *ref_donor = NULL) : reffed_ptr(e, ref_donor) { assert(upbdefs_google_protobuf_FileOptions_OptimizeMode_is(e)); } static OptimizeMode get() { - const upb::EnumDef* e = upbdefs_google_protobuf_FileOptions_OptimizeMode_get(&e); + const ::upb::EnumDef* e = upbdefs_google_protobuf_FileOptions_OptimizeMode_get(&e); return OptimizeMode(e, &e); } }; }; -class MessageOptions : public upb::reffed_ptr { +class MessageOptions : public ::upb::reffed_ptr { public: - MessageOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + MessageOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_MessageOptions_is(m)); } static MessageOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_MessageOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_MessageOptions_get(&m); return MessageOptions(m, &m); } }; -class MethodDescriptorProto : public upb::reffed_ptr { +class MethodDescriptorProto : public ::upb::reffed_ptr { public: - MethodDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + MethodDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_MethodDescriptorProto_is(m)); } static MethodDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_MethodDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_MethodDescriptorProto_get(&m); return MethodDescriptorProto(m, &m); } }; -class MethodOptions : public upb::reffed_ptr { +class MethodOptions : public ::upb::reffed_ptr { public: - MethodOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + MethodOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_MethodOptions_is(m)); } static MethodOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_MethodOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_MethodOptions_get(&m); return MethodOptions(m, &m); } }; -class OneofDescriptorProto : public upb::reffed_ptr { +class OneofDescriptorProto : public ::upb::reffed_ptr { public: - OneofDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + OneofDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_OneofDescriptorProto_is(m)); } static OneofDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_OneofDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_OneofDescriptorProto_get(&m); return OneofDescriptorProto(m, &m); } }; -class ServiceDescriptorProto : public upb::reffed_ptr { +class ServiceDescriptorProto : public ::upb::reffed_ptr { public: - ServiceDescriptorProto(const upb::MessageDef* m, const void *ref_donor = NULL) + ServiceDescriptorProto(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_ServiceDescriptorProto_is(m)); } static ServiceDescriptorProto get() { - const upb::MessageDef* m = upbdefs_google_protobuf_ServiceDescriptorProto_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_ServiceDescriptorProto_get(&m); return ServiceDescriptorProto(m, &m); } }; -class ServiceOptions : public upb::reffed_ptr { +class ServiceOptions : public ::upb::reffed_ptr { public: - ServiceOptions(const upb::MessageDef* m, const void *ref_donor = NULL) + ServiceOptions(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_ServiceOptions_is(m)); } static ServiceOptions get() { - const upb::MessageDef* m = upbdefs_google_protobuf_ServiceOptions_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_ServiceOptions_get(&m); return ServiceOptions(m, &m); } }; -class SourceCodeInfo : public upb::reffed_ptr { +class SourceCodeInfo : public ::upb::reffed_ptr { public: - SourceCodeInfo(const upb::MessageDef* m, const void *ref_donor = NULL) + SourceCodeInfo(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_SourceCodeInfo_is(m)); } static SourceCodeInfo get() { - const upb::MessageDef* m = upbdefs_google_protobuf_SourceCodeInfo_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_SourceCodeInfo_get(&m); return SourceCodeInfo(m, &m); } - class Location : public upb::reffed_ptr { + class Location : public ::upb::reffed_ptr { public: - Location(const upb::MessageDef* m, const void *ref_donor = NULL) + Location(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_SourceCodeInfo_Location_is(m)); } static Location get() { - const upb::MessageDef* m = upbdefs_google_protobuf_SourceCodeInfo_Location_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_SourceCodeInfo_Location_get(&m); return Location(m, &m); } }; }; -class UninterpretedOption : public upb::reffed_ptr { +class UninterpretedOption : public ::upb::reffed_ptr { public: - UninterpretedOption(const upb::MessageDef* m, const void *ref_donor = NULL) + UninterpretedOption(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_UninterpretedOption_is(m)); } static UninterpretedOption get() { - const upb::MessageDef* m = upbdefs_google_protobuf_UninterpretedOption_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_UninterpretedOption_get(&m); return UninterpretedOption(m, &m); } - class NamePart : public upb::reffed_ptr { + class NamePart : public ::upb::reffed_ptr { public: - NamePart(const upb::MessageDef* m, const void *ref_donor = NULL) + NamePart(const ::upb::MessageDef* m, const void *ref_donor = NULL) : reffed_ptr(m, ref_donor) { assert(upbdefs_google_protobuf_UninterpretedOption_NamePart_is(m)); } static NamePart get() { - const upb::MessageDef* m = upbdefs_google_protobuf_UninterpretedOption_NamePart_get(&m); + const ::upb::MessageDef* m = upbdefs_google_protobuf_UninterpretedOption_NamePart_get(&m); return NamePart(m, &m); } }; -- cgit v1.2.3