diff --git a/cpp/certificate.pb.cc b/cpp/certificate.pb.cc new file mode 100644 index 0000000..41d0c91 --- /dev/null +++ b/cpp/certificate.pb.cc @@ -0,0 +1,530 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: certificate.proto + +#include "certificate.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace pb { +class CertificateDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Certificate_default_instance_; +} // namespace pb +namespace protobuf_certificate_2eproto { +static void InitDefaultsCertificate() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Certificate_default_instance_; + new (ptr) ::pb::Certificate(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Certificate::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Certificate = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCertificate}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Certificate.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, keytype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, publickey_), + 1, + 2, + 0, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 8, sizeof(::pb::Certificate)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Certificate_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "certificate.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\021certificate.proto\022\002pb\"\224\001\n\013Certificate\022" + "(\n\007version\030\001 \002(\0162\027.pb.Certificate.Versio" + "n\022\034\n\007keyType\030\002 \002(\0162\013.pb.KeyType\022\021\n\tpubli" + "cKey\030\004 \002(\014\"*\n\007Version\022\023\n\017UNKNOWN_VERSION" + "\020\000\022\n\n\006_0_0_1\020\001*Q\n\007KeyType\022\033\n\027UNKNOWN_PUB" + "LIC_KEY_TYPE\020\000\022\014\n\010NIST256p\020\001\022\014\n\010NIST384p" + "\020\002\022\r\n\tSECP256k1\020\003" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 257); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "certificate.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_certificate_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Certificate_Version_descriptor() { + protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_certificate_2eproto::file_level_enum_descriptors[0]; +} +bool Certificate_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Certificate_Version Certificate::UNKNOWN_VERSION; +const Certificate_Version Certificate::_0_0_1; +const Certificate_Version Certificate::Version_MIN; +const Certificate_Version Certificate::Version_MAX; +const int Certificate::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* KeyType_descriptor() { + protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_certificate_2eproto::file_level_enum_descriptors[1]; +} +bool KeyType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + + +// =================================================================== + +void Certificate::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Certificate::kVersionFieldNumber; +const int Certificate::kKeyTypeFieldNumber; +const int Certificate::kPublicKeyFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Certificate::Certificate() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_certificate_2eproto::scc_info_Certificate.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Certificate) +} +Certificate::Certificate(const Certificate& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + publickey_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_publickey()) { + publickey_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.publickey_); + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&keytype_) - + reinterpret_cast(&version_)) + sizeof(keytype_)); + // @@protoc_insertion_point(copy_constructor:pb.Certificate) +} + +void Certificate::SharedCtor() { + publickey_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&version_, 0, static_cast( + reinterpret_cast(&keytype_) - + reinterpret_cast(&version_)) + sizeof(keytype_)); +} + +Certificate::~Certificate() { + // @@protoc_insertion_point(destructor:pb.Certificate) + SharedDtor(); +} + +void Certificate::SharedDtor() { + publickey_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Certificate::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Certificate::descriptor() { + ::protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_certificate_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Certificate& Certificate::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_certificate_2eproto::scc_info_Certificate.base); + return *internal_default_instance(); +} + + +void Certificate::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Certificate) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + publickey_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 6u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&keytype_) - + reinterpret_cast(&version_)) + sizeof(keytype_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Certificate::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Certificate) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Certificate.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Certificate_Version_IsValid(value)) { + set_version(static_cast< ::pb::Certificate_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.KeyType keyType = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::KeyType_IsValid(value)) { + set_keytype(static_cast< ::pb::KeyType >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required bytes publicKey = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_publickey())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Certificate) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Certificate) + return false; +#undef DO_ +} + +void Certificate::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Certificate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Certificate.Version version = 1; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.KeyType keyType = 2; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->keytype(), output); + } + + // required bytes publicKey = 4; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->publickey(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Certificate) +} + +::google::protobuf::uint8* Certificate::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Certificate) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Certificate.Version version = 1; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.KeyType keyType = 2; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->keytype(), target); + } + + // required bytes publicKey = 4; + if (cached_has_bits & 0x00000001u) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->publickey(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Certificate) + return target; +} + +size_t Certificate::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Certificate) + size_t total_size = 0; + + if (has_publickey()) { + // required bytes publicKey = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->publickey()); + } + + if (has_version()) { + // required .pb.Certificate.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_keytype()) { + // required .pb.KeyType keyType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->keytype()); + } + + return total_size; +} +size_t Certificate::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Certificate) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present. + // required bytes publicKey = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->publickey()); + + // required .pb.Certificate.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.KeyType keyType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->keytype()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Certificate::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Certificate) + GOOGLE_DCHECK_NE(&from, this); + const Certificate* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Certificate) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Certificate) + MergeFrom(*source); + } +} + +void Certificate::MergeFrom(const Certificate& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Certificate) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 7u) { + if (cached_has_bits & 0x00000001u) { + set_has_publickey(); + publickey_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.publickey_); + } + if (cached_has_bits & 0x00000002u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000004u) { + keytype_ = from.keytype_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Certificate::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Certificate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Certificate::CopyFrom(const Certificate& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Certificate) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Certificate::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + return true; +} + +void Certificate::Swap(Certificate* other) { + if (other == this) return; + InternalSwap(other); +} +void Certificate::InternalSwap(Certificate* other) { + using std::swap; + publickey_.Swap(&other->publickey_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(version_, other->version_); + swap(keytype_, other->keytype_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Certificate::GetMetadata() const { + protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_certificate_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Certificate* Arena::CreateMaybeMessage< ::pb::Certificate >(Arena* arena) { + return Arena::CreateInternal< ::pb::Certificate >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/certificate.pb.h b/cpp/certificate.pb.h new file mode 100644 index 0000000..abae66c --- /dev/null +++ b/cpp/certificate.pb.h @@ -0,0 +1,426 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: certificate.proto + +#ifndef PROTOBUF_INCLUDED_certificate_2eproto +#define PROTOBUF_INCLUDED_certificate_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_certificate_2eproto + +namespace protobuf_certificate_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_certificate_2eproto +namespace pb { +class Certificate; +class CertificateDefaultTypeInternal; +extern CertificateDefaultTypeInternal _Certificate_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Certificate* Arena::CreateMaybeMessage<::pb::Certificate>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Certificate_Version { + Certificate_Version_UNKNOWN_VERSION = 0, + Certificate_Version__0_0_1 = 1 +}; +bool Certificate_Version_IsValid(int value); +const Certificate_Version Certificate_Version_Version_MIN = Certificate_Version_UNKNOWN_VERSION; +const Certificate_Version Certificate_Version_Version_MAX = Certificate_Version__0_0_1; +const int Certificate_Version_Version_ARRAYSIZE = Certificate_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Certificate_Version_descriptor(); +inline const ::std::string& Certificate_Version_Name(Certificate_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Certificate_Version_descriptor(), value); +} +inline bool Certificate_Version_Parse( + const ::std::string& name, Certificate_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Certificate_Version_descriptor(), name, value); +} +enum KeyType { + UNKNOWN_PUBLIC_KEY_TYPE = 0, + NIST256p = 1, + NIST384p = 2, + SECP256k1 = 3 +}; +bool KeyType_IsValid(int value); +const KeyType KeyType_MIN = UNKNOWN_PUBLIC_KEY_TYPE; +const KeyType KeyType_MAX = SECP256k1; +const int KeyType_ARRAYSIZE = KeyType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* KeyType_descriptor(); +inline const ::std::string& KeyType_Name(KeyType value) { + return ::google::protobuf::internal::NameOfEnum( + KeyType_descriptor(), value); +} +inline bool KeyType_Parse( + const ::std::string& name, KeyType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + KeyType_descriptor(), name, value); +} +// =================================================================== + +class Certificate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Certificate) */ { + public: + Certificate(); + virtual ~Certificate(); + + Certificate(const Certificate& from); + + inline Certificate& operator=(const Certificate& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Certificate(Certificate&& from) noexcept + : Certificate() { + *this = ::std::move(from); + } + + inline Certificate& operator=(Certificate&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Certificate& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Certificate* internal_default_instance() { + return reinterpret_cast( + &_Certificate_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Certificate* other); + friend void swap(Certificate& a, Certificate& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Certificate* New() const final { + return CreateMaybeMessage(NULL); + } + + Certificate* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Certificate& from); + void MergeFrom(const Certificate& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Certificate* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Certificate_Version Version; + static const Version UNKNOWN_VERSION = + Certificate_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Certificate_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Certificate_Version_IsValid(value); + } + static const Version Version_MIN = + Certificate_Version_Version_MIN; + static const Version Version_MAX = + Certificate_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Certificate_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Certificate_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Certificate_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Certificate_Version_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required bytes publicKey = 4; + bool has_publickey() const; + void clear_publickey(); + static const int kPublicKeyFieldNumber = 4; + const ::std::string& publickey() const; + void set_publickey(const ::std::string& value); + #if LANG_CXX11 + void set_publickey(::std::string&& value); + #endif + void set_publickey(const char* value); + void set_publickey(const void* value, size_t size); + ::std::string* mutable_publickey(); + ::std::string* release_publickey(); + void set_allocated_publickey(::std::string* publickey); + + // required .pb.Certificate.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Certificate_Version version() const; + void set_version(::pb::Certificate_Version value); + + // required .pb.KeyType keyType = 2; + bool has_keytype() const; + void clear_keytype(); + static const int kKeyTypeFieldNumber = 2; + ::pb::KeyType keytype() const; + void set_keytype(::pb::KeyType value); + + // @@protoc_insertion_point(class_scope:pb.Certificate) + private: + void set_has_version(); + void clear_has_version(); + void set_has_keytype(); + void clear_has_keytype(); + void set_has_publickey(); + void clear_has_publickey(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr publickey_; + int version_; + int keytype_; + friend struct ::protobuf_certificate_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Certificate + +// required .pb.Certificate.Version version = 1; +inline bool Certificate::has_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Certificate::set_has_version() { + _has_bits_[0] |= 0x00000002u; +} +inline void Certificate::clear_has_version() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Certificate::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Certificate_Version Certificate::version() const { + // @@protoc_insertion_point(field_get:pb.Certificate.version) + return static_cast< ::pb::Certificate_Version >(version_); +} +inline void Certificate::set_version(::pb::Certificate_Version value) { + assert(::pb::Certificate_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Certificate.version) +} + +// required .pb.KeyType keyType = 2; +inline bool Certificate::has_keytype() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Certificate::set_has_keytype() { + _has_bits_[0] |= 0x00000004u; +} +inline void Certificate::clear_has_keytype() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Certificate::clear_keytype() { + keytype_ = 0; + clear_has_keytype(); +} +inline ::pb::KeyType Certificate::keytype() const { + // @@protoc_insertion_point(field_get:pb.Certificate.keyType) + return static_cast< ::pb::KeyType >(keytype_); +} +inline void Certificate::set_keytype(::pb::KeyType value) { + assert(::pb::KeyType_IsValid(value)); + set_has_keytype(); + keytype_ = value; + // @@protoc_insertion_point(field_set:pb.Certificate.keyType) +} + +// required bytes publicKey = 4; +inline bool Certificate::has_publickey() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Certificate::set_has_publickey() { + _has_bits_[0] |= 0x00000001u; +} +inline void Certificate::clear_has_publickey() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Certificate::clear_publickey() { + publickey_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_publickey(); +} +inline const ::std::string& Certificate::publickey() const { + // @@protoc_insertion_point(field_get:pb.Certificate.publicKey) + return publickey_.GetNoArena(); +} +inline void Certificate::set_publickey(const ::std::string& value) { + set_has_publickey(); + publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Certificate.publicKey) +} +#if LANG_CXX11 +inline void Certificate::set_publickey(::std::string&& value) { + set_has_publickey(); + publickey_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Certificate.publicKey) +} +#endif +inline void Certificate::set_publickey(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_publickey(); + publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Certificate.publicKey) +} +inline void Certificate::set_publickey(const void* value, size_t size) { + set_has_publickey(); + publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Certificate.publicKey) +} +inline ::std::string* Certificate::mutable_publickey() { + set_has_publickey(); + // @@protoc_insertion_point(field_mutable:pb.Certificate.publicKey) + return publickey_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Certificate::release_publickey() { + // @@protoc_insertion_point(field_release:pb.Certificate.publicKey) + if (!has_publickey()) { + return NULL; + } + clear_has_publickey(); + return publickey_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Certificate::set_allocated_publickey(::std::string* publickey) { + if (publickey != NULL) { + set_has_publickey(); + } else { + clear_has_publickey(); + } + publickey_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), publickey); + // @@protoc_insertion_point(field_set_allocated:pb.Certificate.publicKey) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Certificate_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Certificate_Version>() { + return ::pb::Certificate_Version_descriptor(); +} +template <> struct is_proto_enum< ::pb::KeyType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::KeyType>() { + return ::pb::KeyType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_certificate_2eproto diff --git a/cpp/claim.pb.cc b/cpp/claim.pb.cc new file mode 100644 index 0000000..7429622 --- /dev/null +++ b/cpp/claim.pb.cc @@ -0,0 +1,678 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: claim.proto + +#include "claim.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_certificate_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_certificate_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Certificate; +} // namespace protobuf_certificate_2eproto +namespace protobuf_signature_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_signature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Signature; +} // namespace protobuf_signature_2eproto +namespace protobuf_stream_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_stream_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Stream; +} // namespace protobuf_stream_2eproto +namespace pb { +class ClaimDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Claim_default_instance_; +} // namespace pb +namespace protobuf_claim_2eproto { +static void InitDefaultsClaim() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Claim_default_instance_; + new (ptr) ::pb::Claim(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Claim::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<3> scc_info_Claim = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsClaim}, { + &protobuf_stream_2eproto::scc_info_Stream.base, + &protobuf_certificate_2eproto::scc_info_Certificate.base, + &protobuf_signature_2eproto::scc_info_Signature.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Claim.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, claimtype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, stream_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, certificate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, publishersignature_), + 3, + 4, + 0, + 1, + 2, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 10, sizeof(::pb::Claim)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Claim_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "claim.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\013claim.proto\022\002pb\032\014stream.proto\032\021certifi" + "cate.proto\032\017signature.proto\"\266\002\n\005Claim\022\"\n" + "\007version\030\001 \002(\0162\021.pb.Claim.Version\022&\n\tcla" + "imType\030\002 \002(\0162\023.pb.Claim.ClaimType\022\032\n\006str" + "eam\030\003 \001(\0132\n.pb.Stream\022$\n\013certificate\030\004 \001" + "(\0132\017.pb.Certificate\022)\n\022publisherSignatur" + "e\030\005 \001(\0132\r.pb.Signature\"*\n\007Version\022\023\n\017UNK" + "NOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001\"H\n\tClaimType\022" + "\026\n\022UNKNOWN_CLAIM_TYPE\020\000\022\016\n\nstreamType\020\001\022" + "\023\n\017certificateType\020\002" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 380); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "claim.proto", &protobuf_RegisterTypes); + ::protobuf_stream_2eproto::AddDescriptors(); + ::protobuf_certificate_2eproto::AddDescriptors(); + ::protobuf_signature_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_claim_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Claim_Version_descriptor() { + protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_claim_2eproto::file_level_enum_descriptors[0]; +} +bool Claim_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Claim_Version Claim::UNKNOWN_VERSION; +const Claim_Version Claim::_0_0_1; +const Claim_Version Claim::Version_MIN; +const Claim_Version Claim::Version_MAX; +const int Claim::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* Claim_ClaimType_descriptor() { + protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_claim_2eproto::file_level_enum_descriptors[1]; +} +bool Claim_ClaimType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Claim_ClaimType Claim::UNKNOWN_CLAIM_TYPE; +const Claim_ClaimType Claim::streamType; +const Claim_ClaimType Claim::certificateType; +const Claim_ClaimType Claim::ClaimType_MIN; +const Claim_ClaimType Claim::ClaimType_MAX; +const int Claim::ClaimType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Claim::InitAsDefaultInstance() { + ::pb::_Claim_default_instance_._instance.get_mutable()->stream_ = const_cast< ::pb::Stream*>( + ::pb::Stream::internal_default_instance()); + ::pb::_Claim_default_instance_._instance.get_mutable()->certificate_ = const_cast< ::pb::Certificate*>( + ::pb::Certificate::internal_default_instance()); + ::pb::_Claim_default_instance_._instance.get_mutable()->publishersignature_ = const_cast< ::pb::Signature*>( + ::pb::Signature::internal_default_instance()); +} +void Claim::clear_stream() { + if (stream_ != NULL) stream_->Clear(); + clear_has_stream(); +} +void Claim::clear_certificate() { + if (certificate_ != NULL) certificate_->Clear(); + clear_has_certificate(); +} +void Claim::clear_publishersignature() { + if (publishersignature_ != NULL) publishersignature_->Clear(); + clear_has_publishersignature(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Claim::kVersionFieldNumber; +const int Claim::kClaimTypeFieldNumber; +const int Claim::kStreamFieldNumber; +const int Claim::kCertificateFieldNumber; +const int Claim::kPublisherSignatureFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Claim::Claim() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_claim_2eproto::scc_info_Claim.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Claim) +} +Claim::Claim(const Claim& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_stream()) { + stream_ = new ::pb::Stream(*from.stream_); + } else { + stream_ = NULL; + } + if (from.has_certificate()) { + certificate_ = new ::pb::Certificate(*from.certificate_); + } else { + certificate_ = NULL; + } + if (from.has_publishersignature()) { + publishersignature_ = new ::pb::Signature(*from.publishersignature_); + } else { + publishersignature_ = NULL; + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&claimtype_) - + reinterpret_cast(&version_)) + sizeof(claimtype_)); + // @@protoc_insertion_point(copy_constructor:pb.Claim) +} + +void Claim::SharedCtor() { + ::memset(&stream_, 0, static_cast( + reinterpret_cast(&claimtype_) - + reinterpret_cast(&stream_)) + sizeof(claimtype_)); +} + +Claim::~Claim() { + // @@protoc_insertion_point(destructor:pb.Claim) + SharedDtor(); +} + +void Claim::SharedDtor() { + if (this != internal_default_instance()) delete stream_; + if (this != internal_default_instance()) delete certificate_; + if (this != internal_default_instance()) delete publishersignature_; +} + +void Claim::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Claim::descriptor() { + ::protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_claim_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Claim& Claim::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_claim_2eproto::scc_info_Claim.base); + return *internal_default_instance(); +} + + +void Claim::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Claim) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 7u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(stream_ != NULL); + stream_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(certificate_ != NULL); + certificate_->Clear(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(publishersignature_ != NULL); + publishersignature_->Clear(); + } + } + if (cached_has_bits & 24u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&claimtype_) - + reinterpret_cast(&version_)) + sizeof(claimtype_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Claim::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Claim) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Claim.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Claim_Version_IsValid(value)) { + set_version(static_cast< ::pb::Claim_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Claim.ClaimType claimType = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Claim_ClaimType_IsValid(value)) { + set_claimtype(static_cast< ::pb::Claim_ClaimType >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // optional .pb.Stream stream = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_stream())); + } else { + goto handle_unusual; + } + break; + } + + // optional .pb.Certificate certificate = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_certificate())); + } else { + goto handle_unusual; + } + break; + } + + // optional .pb.Signature publisherSignature = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_publishersignature())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Claim) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Claim) + return false; +#undef DO_ +} + +void Claim::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Claim) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Claim.Version version = 1; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.Claim.ClaimType claimType = 2; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->claimtype(), output); + } + + // optional .pb.Stream stream = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_stream(), output); + } + + // optional .pb.Certificate certificate = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->_internal_certificate(), output); + } + + // optional .pb.Signature publisherSignature = 5; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->_internal_publishersignature(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Claim) +} + +::google::protobuf::uint8* Claim::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Claim) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Claim.Version version = 1; + if (cached_has_bits & 0x00000008u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.Claim.ClaimType claimType = 2; + if (cached_has_bits & 0x00000010u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->claimtype(), target); + } + + // optional .pb.Stream stream = 3; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_stream(), deterministic, target); + } + + // optional .pb.Certificate certificate = 4; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 4, this->_internal_certificate(), deterministic, target); + } + + // optional .pb.Signature publisherSignature = 5; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 5, this->_internal_publishersignature(), deterministic, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Claim) + return target; +} + +size_t Claim::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Claim) + size_t total_size = 0; + + if (has_version()) { + // required .pb.Claim.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_claimtype()) { + // required .pb.Claim.ClaimType claimType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->claimtype()); + } + + return total_size; +} +size_t Claim::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Claim) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x00000018) ^ 0x00000018) == 0) { // All required fields are present. + // required .pb.Claim.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.Claim.ClaimType claimType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->claimtype()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + if (_has_bits_[0 / 32] & 7u) { + // optional .pb.Stream stream = 3; + if (has_stream()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *stream_); + } + + // optional .pb.Certificate certificate = 4; + if (has_certificate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *certificate_); + } + + // optional .pb.Signature publisherSignature = 5; + if (has_publishersignature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *publishersignature_); + } + + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Claim::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Claim) + GOOGLE_DCHECK_NE(&from, this); + const Claim* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Claim) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Claim) + MergeFrom(*source); + } +} + +void Claim::MergeFrom(const Claim& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Claim) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 31u) { + if (cached_has_bits & 0x00000001u) { + mutable_stream()->::pb::Stream::MergeFrom(from.stream()); + } + if (cached_has_bits & 0x00000002u) { + mutable_certificate()->::pb::Certificate::MergeFrom(from.certificate()); + } + if (cached_has_bits & 0x00000004u) { + mutable_publishersignature()->::pb::Signature::MergeFrom(from.publishersignature()); + } + if (cached_has_bits & 0x00000008u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000010u) { + claimtype_ = from.claimtype_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Claim::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Claim) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Claim::CopyFrom(const Claim& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Claim) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Claim::IsInitialized() const { + if ((_has_bits_[0] & 0x00000018) != 0x00000018) return false; + if (has_stream()) { + if (!this->stream_->IsInitialized()) return false; + } + if (has_certificate()) { + if (!this->certificate_->IsInitialized()) return false; + } + if (has_publishersignature()) { + if (!this->publishersignature_->IsInitialized()) return false; + } + return true; +} + +void Claim::Swap(Claim* other) { + if (other == this) return; + InternalSwap(other); +} +void Claim::InternalSwap(Claim* other) { + using std::swap; + swap(stream_, other->stream_); + swap(certificate_, other->certificate_); + swap(publishersignature_, other->publishersignature_); + swap(version_, other->version_); + swap(claimtype_, other->claimtype_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Claim::GetMetadata() const { + protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_claim_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Claim* Arena::CreateMaybeMessage< ::pb::Claim >(Arena* arena) { + return Arena::CreateInternal< ::pb::Claim >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/claim.pb.h b/cpp/claim.pb.h new file mode 100644 index 0000000..9f29c90 --- /dev/null +++ b/cpp/claim.pb.h @@ -0,0 +1,579 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: claim.proto + +#ifndef PROTOBUF_INCLUDED_claim_2eproto +#define PROTOBUF_INCLUDED_claim_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "stream.pb.h" +#include "certificate.pb.h" +#include "signature.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_claim_2eproto + +namespace protobuf_claim_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_claim_2eproto +namespace pb { +class Claim; +class ClaimDefaultTypeInternal; +extern ClaimDefaultTypeInternal _Claim_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Claim* Arena::CreateMaybeMessage<::pb::Claim>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Claim_Version { + Claim_Version_UNKNOWN_VERSION = 0, + Claim_Version__0_0_1 = 1 +}; +bool Claim_Version_IsValid(int value); +const Claim_Version Claim_Version_Version_MIN = Claim_Version_UNKNOWN_VERSION; +const Claim_Version Claim_Version_Version_MAX = Claim_Version__0_0_1; +const int Claim_Version_Version_ARRAYSIZE = Claim_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Claim_Version_descriptor(); +inline const ::std::string& Claim_Version_Name(Claim_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Claim_Version_descriptor(), value); +} +inline bool Claim_Version_Parse( + const ::std::string& name, Claim_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Claim_Version_descriptor(), name, value); +} +enum Claim_ClaimType { + Claim_ClaimType_UNKNOWN_CLAIM_TYPE = 0, + Claim_ClaimType_streamType = 1, + Claim_ClaimType_certificateType = 2 +}; +bool Claim_ClaimType_IsValid(int value); +const Claim_ClaimType Claim_ClaimType_ClaimType_MIN = Claim_ClaimType_UNKNOWN_CLAIM_TYPE; +const Claim_ClaimType Claim_ClaimType_ClaimType_MAX = Claim_ClaimType_certificateType; +const int Claim_ClaimType_ClaimType_ARRAYSIZE = Claim_ClaimType_ClaimType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Claim_ClaimType_descriptor(); +inline const ::std::string& Claim_ClaimType_Name(Claim_ClaimType value) { + return ::google::protobuf::internal::NameOfEnum( + Claim_ClaimType_descriptor(), value); +} +inline bool Claim_ClaimType_Parse( + const ::std::string& name, Claim_ClaimType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Claim_ClaimType_descriptor(), name, value); +} +// =================================================================== + +class Claim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Claim) */ { + public: + Claim(); + virtual ~Claim(); + + Claim(const Claim& from); + + inline Claim& operator=(const Claim& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Claim(Claim&& from) noexcept + : Claim() { + *this = ::std::move(from); + } + + inline Claim& operator=(Claim&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Claim& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Claim* internal_default_instance() { + return reinterpret_cast( + &_Claim_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Claim* other); + friend void swap(Claim& a, Claim& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Claim* New() const final { + return CreateMaybeMessage(NULL); + } + + Claim* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Claim& from); + void MergeFrom(const Claim& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Claim* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Claim_Version Version; + static const Version UNKNOWN_VERSION = + Claim_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Claim_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Claim_Version_IsValid(value); + } + static const Version Version_MIN = + Claim_Version_Version_MIN; + static const Version Version_MAX = + Claim_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Claim_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Claim_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Claim_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Claim_Version_Parse(name, value); + } + + typedef Claim_ClaimType ClaimType; + static const ClaimType UNKNOWN_CLAIM_TYPE = + Claim_ClaimType_UNKNOWN_CLAIM_TYPE; + static const ClaimType streamType = + Claim_ClaimType_streamType; + static const ClaimType certificateType = + Claim_ClaimType_certificateType; + static inline bool ClaimType_IsValid(int value) { + return Claim_ClaimType_IsValid(value); + } + static const ClaimType ClaimType_MIN = + Claim_ClaimType_ClaimType_MIN; + static const ClaimType ClaimType_MAX = + Claim_ClaimType_ClaimType_MAX; + static const int ClaimType_ARRAYSIZE = + Claim_ClaimType_ClaimType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + ClaimType_descriptor() { + return Claim_ClaimType_descriptor(); + } + static inline const ::std::string& ClaimType_Name(ClaimType value) { + return Claim_ClaimType_Name(value); + } + static inline bool ClaimType_Parse(const ::std::string& name, + ClaimType* value) { + return Claim_ClaimType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .pb.Stream stream = 3; + bool has_stream() const; + void clear_stream(); + static const int kStreamFieldNumber = 3; + private: + const ::pb::Stream& _internal_stream() const; + public: + const ::pb::Stream& stream() const; + ::pb::Stream* release_stream(); + ::pb::Stream* mutable_stream(); + void set_allocated_stream(::pb::Stream* stream); + + // optional .pb.Certificate certificate = 4; + bool has_certificate() const; + void clear_certificate(); + static const int kCertificateFieldNumber = 4; + private: + const ::pb::Certificate& _internal_certificate() const; + public: + const ::pb::Certificate& certificate() const; + ::pb::Certificate* release_certificate(); + ::pb::Certificate* mutable_certificate(); + void set_allocated_certificate(::pb::Certificate* certificate); + + // optional .pb.Signature publisherSignature = 5; + bool has_publishersignature() const; + void clear_publishersignature(); + static const int kPublisherSignatureFieldNumber = 5; + private: + const ::pb::Signature& _internal_publishersignature() const; + public: + const ::pb::Signature& publishersignature() const; + ::pb::Signature* release_publishersignature(); + ::pb::Signature* mutable_publishersignature(); + void set_allocated_publishersignature(::pb::Signature* publishersignature); + + // required .pb.Claim.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Claim_Version version() const; + void set_version(::pb::Claim_Version value); + + // required .pb.Claim.ClaimType claimType = 2; + bool has_claimtype() const; + void clear_claimtype(); + static const int kClaimTypeFieldNumber = 2; + ::pb::Claim_ClaimType claimtype() const; + void set_claimtype(::pb::Claim_ClaimType value); + + // @@protoc_insertion_point(class_scope:pb.Claim) + private: + void set_has_version(); + void clear_has_version(); + void set_has_claimtype(); + void clear_has_claimtype(); + void set_has_stream(); + void clear_has_stream(); + void set_has_certificate(); + void clear_has_certificate(); + void set_has_publishersignature(); + void clear_has_publishersignature(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::pb::Stream* stream_; + ::pb::Certificate* certificate_; + ::pb::Signature* publishersignature_; + int version_; + int claimtype_; + friend struct ::protobuf_claim_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Claim + +// required .pb.Claim.Version version = 1; +inline bool Claim::has_version() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Claim::set_has_version() { + _has_bits_[0] |= 0x00000008u; +} +inline void Claim::clear_has_version() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Claim::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Claim_Version Claim::version() const { + // @@protoc_insertion_point(field_get:pb.Claim.version) + return static_cast< ::pb::Claim_Version >(version_); +} +inline void Claim::set_version(::pb::Claim_Version value) { + assert(::pb::Claim_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Claim.version) +} + +// required .pb.Claim.ClaimType claimType = 2; +inline bool Claim::has_claimtype() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Claim::set_has_claimtype() { + _has_bits_[0] |= 0x00000010u; +} +inline void Claim::clear_has_claimtype() { + _has_bits_[0] &= ~0x00000010u; +} +inline void Claim::clear_claimtype() { + claimtype_ = 0; + clear_has_claimtype(); +} +inline ::pb::Claim_ClaimType Claim::claimtype() const { + // @@protoc_insertion_point(field_get:pb.Claim.claimType) + return static_cast< ::pb::Claim_ClaimType >(claimtype_); +} +inline void Claim::set_claimtype(::pb::Claim_ClaimType value) { + assert(::pb::Claim_ClaimType_IsValid(value)); + set_has_claimtype(); + claimtype_ = value; + // @@protoc_insertion_point(field_set:pb.Claim.claimType) +} + +// optional .pb.Stream stream = 3; +inline bool Claim::has_stream() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Claim::set_has_stream() { + _has_bits_[0] |= 0x00000001u; +} +inline void Claim::clear_has_stream() { + _has_bits_[0] &= ~0x00000001u; +} +inline const ::pb::Stream& Claim::_internal_stream() const { + return *stream_; +} +inline const ::pb::Stream& Claim::stream() const { + const ::pb::Stream* p = stream_; + // @@protoc_insertion_point(field_get:pb.Claim.stream) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Stream_default_instance_); +} +inline ::pb::Stream* Claim::release_stream() { + // @@protoc_insertion_point(field_release:pb.Claim.stream) + clear_has_stream(); + ::pb::Stream* temp = stream_; + stream_ = NULL; + return temp; +} +inline ::pb::Stream* Claim::mutable_stream() { + set_has_stream(); + if (stream_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Stream>(GetArenaNoVirtual()); + stream_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Claim.stream) + return stream_; +} +inline void Claim::set_allocated_stream(::pb::Stream* stream) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(stream_); + } + if (stream) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + stream = ::google::protobuf::internal::GetOwnedMessage( + message_arena, stream, submessage_arena); + } + set_has_stream(); + } else { + clear_has_stream(); + } + stream_ = stream; + // @@protoc_insertion_point(field_set_allocated:pb.Claim.stream) +} + +// optional .pb.Certificate certificate = 4; +inline bool Claim::has_certificate() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Claim::set_has_certificate() { + _has_bits_[0] |= 0x00000002u; +} +inline void Claim::clear_has_certificate() { + _has_bits_[0] &= ~0x00000002u; +} +inline const ::pb::Certificate& Claim::_internal_certificate() const { + return *certificate_; +} +inline const ::pb::Certificate& Claim::certificate() const { + const ::pb::Certificate* p = certificate_; + // @@protoc_insertion_point(field_get:pb.Claim.certificate) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Certificate_default_instance_); +} +inline ::pb::Certificate* Claim::release_certificate() { + // @@protoc_insertion_point(field_release:pb.Claim.certificate) + clear_has_certificate(); + ::pb::Certificate* temp = certificate_; + certificate_ = NULL; + return temp; +} +inline ::pb::Certificate* Claim::mutable_certificate() { + set_has_certificate(); + if (certificate_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Certificate>(GetArenaNoVirtual()); + certificate_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Claim.certificate) + return certificate_; +} +inline void Claim::set_allocated_certificate(::pb::Certificate* certificate) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(certificate_); + } + if (certificate) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + certificate = ::google::protobuf::internal::GetOwnedMessage( + message_arena, certificate, submessage_arena); + } + set_has_certificate(); + } else { + clear_has_certificate(); + } + certificate_ = certificate; + // @@protoc_insertion_point(field_set_allocated:pb.Claim.certificate) +} + +// optional .pb.Signature publisherSignature = 5; +inline bool Claim::has_publishersignature() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Claim::set_has_publishersignature() { + _has_bits_[0] |= 0x00000004u; +} +inline void Claim::clear_has_publishersignature() { + _has_bits_[0] &= ~0x00000004u; +} +inline const ::pb::Signature& Claim::_internal_publishersignature() const { + return *publishersignature_; +} +inline const ::pb::Signature& Claim::publishersignature() const { + const ::pb::Signature* p = publishersignature_; + // @@protoc_insertion_point(field_get:pb.Claim.publisherSignature) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Signature_default_instance_); +} +inline ::pb::Signature* Claim::release_publishersignature() { + // @@protoc_insertion_point(field_release:pb.Claim.publisherSignature) + clear_has_publishersignature(); + ::pb::Signature* temp = publishersignature_; + publishersignature_ = NULL; + return temp; +} +inline ::pb::Signature* Claim::mutable_publishersignature() { + set_has_publishersignature(); + if (publishersignature_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Signature>(GetArenaNoVirtual()); + publishersignature_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Claim.publisherSignature) + return publishersignature_; +} +inline void Claim::set_allocated_publishersignature(::pb::Signature* publishersignature) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(publishersignature_); + } + if (publishersignature) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + publishersignature = ::google::protobuf::internal::GetOwnedMessage( + message_arena, publishersignature, submessage_arena); + } + set_has_publishersignature(); + } else { + clear_has_publishersignature(); + } + publishersignature_ = publishersignature; + // @@protoc_insertion_point(field_set_allocated:pb.Claim.publisherSignature) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Claim_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Claim_Version>() { + return ::pb::Claim_Version_descriptor(); +} +template <> struct is_proto_enum< ::pb::Claim_ClaimType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Claim_ClaimType>() { + return ::pb::Claim_ClaimType_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_claim_2eproto diff --git a/cpp/fee.pb.cc b/cpp/fee.pb.cc new file mode 100644 index 0000000..87fe489 --- /dev/null +++ b/cpp/fee.pb.cc @@ -0,0 +1,577 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: fee.proto + +#include "fee.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace pb { +class FeeDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Fee_default_instance_; +} // namespace pb +namespace protobuf_fee_2eproto { +static void InitDefaultsFee() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Fee_default_instance_; + new (ptr) ::pb::Fee(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Fee::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Fee = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFee}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Fee.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, currency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, address_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, amount_), + 1, + 2, + 0, + 3, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, sizeof(::pb::Fee)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Fee_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "fee.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\tfee.proto\022\002pb\"\325\001\n\003Fee\022 \n\007version\030\001 \002(\016" + "2\017.pb.Fee.Version\022\"\n\010currency\030\002 \002(\0162\020.pb" + ".Fee.Currency\022\017\n\007address\030\003 \002(\014\022\016\n\006amount" + "\030\004 \002(\002\"*\n\007Version\022\023\n\017UNKNOWN_VERSION\020\000\022\n" + "\n\006_0_0_1\020\001\";\n\010Currency\022\024\n\020UNKNOWN_CURREN" + "CY\020\000\022\007\n\003LBC\020\001\022\007\n\003BTC\020\002\022\007\n\003USD\020\003" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 231); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "fee.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_fee_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Fee_Version_descriptor() { + protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_fee_2eproto::file_level_enum_descriptors[0]; +} +bool Fee_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Fee_Version Fee::UNKNOWN_VERSION; +const Fee_Version Fee::_0_0_1; +const Fee_Version Fee::Version_MIN; +const Fee_Version Fee::Version_MAX; +const int Fee::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* Fee_Currency_descriptor() { + protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_fee_2eproto::file_level_enum_descriptors[1]; +} +bool Fee_Currency_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Fee_Currency Fee::UNKNOWN_CURRENCY; +const Fee_Currency Fee::LBC; +const Fee_Currency Fee::BTC; +const Fee_Currency Fee::USD; +const Fee_Currency Fee::Currency_MIN; +const Fee_Currency Fee::Currency_MAX; +const int Fee::Currency_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Fee::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Fee::kVersionFieldNumber; +const int Fee::kCurrencyFieldNumber; +const int Fee::kAddressFieldNumber; +const int Fee::kAmountFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Fee::Fee() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_fee_2eproto::scc_info_Fee.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Fee) +} +Fee::Fee(const Fee& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_address()) { + address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_); + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&amount_) - + reinterpret_cast(&version_)) + sizeof(amount_)); + // @@protoc_insertion_point(copy_constructor:pb.Fee) +} + +void Fee::SharedCtor() { + address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&version_, 0, static_cast( + reinterpret_cast(&amount_) - + reinterpret_cast(&version_)) + sizeof(amount_)); +} + +Fee::~Fee() { + // @@protoc_insertion_point(destructor:pb.Fee) + SharedDtor(); +} + +void Fee::SharedDtor() { + address_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Fee::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Fee::descriptor() { + ::protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_fee_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Fee& Fee::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_fee_2eproto::scc_info_Fee.base); + return *internal_default_instance(); +} + + +void Fee::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Fee) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + address_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 14u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&amount_) - + reinterpret_cast(&version_)) + sizeof(amount_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Fee::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Fee) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Fee.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Fee_Version_IsValid(value)) { + set_version(static_cast< ::pb::Fee_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Fee.Currency currency = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Fee_Currency_IsValid(value)) { + set_currency(static_cast< ::pb::Fee_Currency >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required bytes address = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_address())); + } else { + goto handle_unusual; + } + break; + } + + // required float amount = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + set_has_amount(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &amount_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Fee) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Fee) + return false; +#undef DO_ +} + +void Fee::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Fee) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Fee.Version version = 1; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.Fee.Currency currency = 2; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->currency(), output); + } + + // required bytes address = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->address(), output); + } + + // required float amount = 4; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->amount(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Fee) +} + +::google::protobuf::uint8* Fee::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Fee) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Fee.Version version = 1; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.Fee.Currency currency = 2; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->currency(), target); + } + + // required bytes address = 3; + if (cached_has_bits & 0x00000001u) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->address(), target); + } + + // required float amount = 4; + if (cached_has_bits & 0x00000008u) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->amount(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Fee) + return target; +} + +size_t Fee::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Fee) + size_t total_size = 0; + + if (has_address()) { + // required bytes address = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->address()); + } + + if (has_version()) { + // required .pb.Fee.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_currency()) { + // required .pb.Fee.Currency currency = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->currency()); + } + + if (has_amount()) { + // required float amount = 4; + total_size += 1 + 4; + } + + return total_size; +} +size_t Fee::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Fee) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present. + // required bytes address = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->address()); + + // required .pb.Fee.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.Fee.Currency currency = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->currency()); + + // required float amount = 4; + total_size += 1 + 4; + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Fee::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Fee) + GOOGLE_DCHECK_NE(&from, this); + const Fee* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Fee) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Fee) + MergeFrom(*source); + } +} + +void Fee::MergeFrom(const Fee& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Fee) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 15u) { + if (cached_has_bits & 0x00000001u) { + set_has_address(); + address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_); + } + if (cached_has_bits & 0x00000002u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000004u) { + currency_ = from.currency_; + } + if (cached_has_bits & 0x00000008u) { + amount_ = from.amount_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Fee::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Fee) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Fee::CopyFrom(const Fee& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Fee) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Fee::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + return true; +} + +void Fee::Swap(Fee* other) { + if (other == this) return; + InternalSwap(other); +} +void Fee::InternalSwap(Fee* other) { + using std::swap; + address_.Swap(&other->address_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(version_, other->version_); + swap(currency_, other->currency_); + swap(amount_, other->amount_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Fee::GetMetadata() const { + protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_fee_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Fee* Arena::CreateMaybeMessage< ::pb::Fee >(Arena* arena) { + return Arena::CreateInternal< ::pb::Fee >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/fee.pb.h b/cpp/fee.pb.h new file mode 100644 index 0000000..e675435 --- /dev/null +++ b/cpp/fee.pb.h @@ -0,0 +1,490 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: fee.proto + +#ifndef PROTOBUF_INCLUDED_fee_2eproto +#define PROTOBUF_INCLUDED_fee_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_fee_2eproto + +namespace protobuf_fee_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_fee_2eproto +namespace pb { +class Fee; +class FeeDefaultTypeInternal; +extern FeeDefaultTypeInternal _Fee_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Fee* Arena::CreateMaybeMessage<::pb::Fee>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Fee_Version { + Fee_Version_UNKNOWN_VERSION = 0, + Fee_Version__0_0_1 = 1 +}; +bool Fee_Version_IsValid(int value); +const Fee_Version Fee_Version_Version_MIN = Fee_Version_UNKNOWN_VERSION; +const Fee_Version Fee_Version_Version_MAX = Fee_Version__0_0_1; +const int Fee_Version_Version_ARRAYSIZE = Fee_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Fee_Version_descriptor(); +inline const ::std::string& Fee_Version_Name(Fee_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Fee_Version_descriptor(), value); +} +inline bool Fee_Version_Parse( + const ::std::string& name, Fee_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Fee_Version_descriptor(), name, value); +} +enum Fee_Currency { + Fee_Currency_UNKNOWN_CURRENCY = 0, + Fee_Currency_LBC = 1, + Fee_Currency_BTC = 2, + Fee_Currency_USD = 3 +}; +bool Fee_Currency_IsValid(int value); +const Fee_Currency Fee_Currency_Currency_MIN = Fee_Currency_UNKNOWN_CURRENCY; +const Fee_Currency Fee_Currency_Currency_MAX = Fee_Currency_USD; +const int Fee_Currency_Currency_ARRAYSIZE = Fee_Currency_Currency_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Fee_Currency_descriptor(); +inline const ::std::string& Fee_Currency_Name(Fee_Currency value) { + return ::google::protobuf::internal::NameOfEnum( + Fee_Currency_descriptor(), value); +} +inline bool Fee_Currency_Parse( + const ::std::string& name, Fee_Currency* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Fee_Currency_descriptor(), name, value); +} +// =================================================================== + +class Fee : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Fee) */ { + public: + Fee(); + virtual ~Fee(); + + Fee(const Fee& from); + + inline Fee& operator=(const Fee& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Fee(Fee&& from) noexcept + : Fee() { + *this = ::std::move(from); + } + + inline Fee& operator=(Fee&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Fee& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Fee* internal_default_instance() { + return reinterpret_cast( + &_Fee_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Fee* other); + friend void swap(Fee& a, Fee& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Fee* New() const final { + return CreateMaybeMessage(NULL); + } + + Fee* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Fee& from); + void MergeFrom(const Fee& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Fee* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Fee_Version Version; + static const Version UNKNOWN_VERSION = + Fee_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Fee_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Fee_Version_IsValid(value); + } + static const Version Version_MIN = + Fee_Version_Version_MIN; + static const Version Version_MAX = + Fee_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Fee_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Fee_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Fee_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Fee_Version_Parse(name, value); + } + + typedef Fee_Currency Currency; + static const Currency UNKNOWN_CURRENCY = + Fee_Currency_UNKNOWN_CURRENCY; + static const Currency LBC = + Fee_Currency_LBC; + static const Currency BTC = + Fee_Currency_BTC; + static const Currency USD = + Fee_Currency_USD; + static inline bool Currency_IsValid(int value) { + return Fee_Currency_IsValid(value); + } + static const Currency Currency_MIN = + Fee_Currency_Currency_MIN; + static const Currency Currency_MAX = + Fee_Currency_Currency_MAX; + static const int Currency_ARRAYSIZE = + Fee_Currency_Currency_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Currency_descriptor() { + return Fee_Currency_descriptor(); + } + static inline const ::std::string& Currency_Name(Currency value) { + return Fee_Currency_Name(value); + } + static inline bool Currency_Parse(const ::std::string& name, + Currency* value) { + return Fee_Currency_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required bytes address = 3; + bool has_address() const; + void clear_address(); + static const int kAddressFieldNumber = 3; + const ::std::string& address() const; + void set_address(const ::std::string& value); + #if LANG_CXX11 + void set_address(::std::string&& value); + #endif + void set_address(const char* value); + void set_address(const void* value, size_t size); + ::std::string* mutable_address(); + ::std::string* release_address(); + void set_allocated_address(::std::string* address); + + // required .pb.Fee.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Fee_Version version() const; + void set_version(::pb::Fee_Version value); + + // required .pb.Fee.Currency currency = 2; + bool has_currency() const; + void clear_currency(); + static const int kCurrencyFieldNumber = 2; + ::pb::Fee_Currency currency() const; + void set_currency(::pb::Fee_Currency value); + + // required float amount = 4; + bool has_amount() const; + void clear_amount(); + static const int kAmountFieldNumber = 4; + float amount() const; + void set_amount(float value); + + // @@protoc_insertion_point(class_scope:pb.Fee) + private: + void set_has_version(); + void clear_has_version(); + void set_has_currency(); + void clear_has_currency(); + void set_has_address(); + void clear_has_address(); + void set_has_amount(); + void clear_has_amount(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr address_; + int version_; + int currency_; + float amount_; + friend struct ::protobuf_fee_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Fee + +// required .pb.Fee.Version version = 1; +inline bool Fee::has_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Fee::set_has_version() { + _has_bits_[0] |= 0x00000002u; +} +inline void Fee::clear_has_version() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Fee::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Fee_Version Fee::version() const { + // @@protoc_insertion_point(field_get:pb.Fee.version) + return static_cast< ::pb::Fee_Version >(version_); +} +inline void Fee::set_version(::pb::Fee_Version value) { + assert(::pb::Fee_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Fee.version) +} + +// required .pb.Fee.Currency currency = 2; +inline bool Fee::has_currency() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Fee::set_has_currency() { + _has_bits_[0] |= 0x00000004u; +} +inline void Fee::clear_has_currency() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Fee::clear_currency() { + currency_ = 0; + clear_has_currency(); +} +inline ::pb::Fee_Currency Fee::currency() const { + // @@protoc_insertion_point(field_get:pb.Fee.currency) + return static_cast< ::pb::Fee_Currency >(currency_); +} +inline void Fee::set_currency(::pb::Fee_Currency value) { + assert(::pb::Fee_Currency_IsValid(value)); + set_has_currency(); + currency_ = value; + // @@protoc_insertion_point(field_set:pb.Fee.currency) +} + +// required bytes address = 3; +inline bool Fee::has_address() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Fee::set_has_address() { + _has_bits_[0] |= 0x00000001u; +} +inline void Fee::clear_has_address() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Fee::clear_address() { + address_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_address(); +} +inline const ::std::string& Fee::address() const { + // @@protoc_insertion_point(field_get:pb.Fee.address) + return address_.GetNoArena(); +} +inline void Fee::set_address(const ::std::string& value) { + set_has_address(); + address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Fee.address) +} +#if LANG_CXX11 +inline void Fee::set_address(::std::string&& value) { + set_has_address(); + address_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Fee.address) +} +#endif +inline void Fee::set_address(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_address(); + address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Fee.address) +} +inline void Fee::set_address(const void* value, size_t size) { + set_has_address(); + address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Fee.address) +} +inline ::std::string* Fee::mutable_address() { + set_has_address(); + // @@protoc_insertion_point(field_mutable:pb.Fee.address) + return address_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Fee::release_address() { + // @@protoc_insertion_point(field_release:pb.Fee.address) + if (!has_address()) { + return NULL; + } + clear_has_address(); + return address_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Fee::set_allocated_address(::std::string* address) { + if (address != NULL) { + set_has_address(); + } else { + clear_has_address(); + } + address_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), address); + // @@protoc_insertion_point(field_set_allocated:pb.Fee.address) +} + +// required float amount = 4; +inline bool Fee::has_amount() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Fee::set_has_amount() { + _has_bits_[0] |= 0x00000008u; +} +inline void Fee::clear_has_amount() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Fee::clear_amount() { + amount_ = 0; + clear_has_amount(); +} +inline float Fee::amount() const { + // @@protoc_insertion_point(field_get:pb.Fee.amount) + return amount_; +} +inline void Fee::set_amount(float value) { + set_has_amount(); + amount_ = value; + // @@protoc_insertion_point(field_set:pb.Fee.amount) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Fee_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Fee_Version>() { + return ::pb::Fee_Version_descriptor(); +} +template <> struct is_proto_enum< ::pb::Fee_Currency> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Fee_Currency>() { + return ::pb::Fee_Currency_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_fee_2eproto diff --git a/cpp/metadata.pb.cc b/cpp/metadata.pb.cc new file mode 100644 index 0000000..c14c70f --- /dev/null +++ b/cpp/metadata.pb.cc @@ -0,0 +1,1456 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: metadata.proto + +#include "metadata.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_fee_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_fee_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Fee; +} // namespace protobuf_fee_2eproto +namespace pb { +class MetadataDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Metadata_default_instance_; +} // namespace pb +namespace protobuf_metadata_2eproto { +static void InitDefaultsMetadata() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Metadata_default_instance_; + new (ptr) ::pb::Metadata(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Metadata::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<1> scc_info_Metadata = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsMetadata}, { + &protobuf_fee_2eproto::scc_info_Fee.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Metadata.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, language_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, title_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, description_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, author_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, license_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, nsfw_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, fee_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, thumbnail_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, preview_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Metadata, licenseurl_), + 8, + 9, + 0, + 1, + 2, + 3, + 10, + 7, + 4, + 5, + 6, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 16, sizeof(::pb::Metadata)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Metadata_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "metadata.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\016metadata.proto\022\002pb\032\tfee.proto\"\347\016\n\010Meta" + "data\022%\n\007version\030\001 \002(\0162\024.pb.Metadata.Vers" + "ion\022\'\n\010language\030\002 \002(\0162\025.pb.Metadata.Lang" + "uage\022\r\n\005title\030\003 \002(\t\022\023\n\013description\030\004 \002(\t" + "\022\016\n\006author\030\005 \002(\t\022\017\n\007license\030\006 \002(\t\022\014\n\004nsf" + "w\030\007 \002(\010\022\024\n\003fee\030\010 \001(\0132\007.pb.Fee\022\021\n\tthumbna" + "il\030\t \001(\t\022\017\n\007preview\030\n \001(\t\022\022\n\nlicenseUrl\030" + "\013 \001(\t\"N\n\007Version\022\023\n\017UNKNOWN_VERSION\020\000\022\n\n" + "\006_0_0_1\020\001\022\n\n\006_0_0_2\020\002\022\n\n\006_0_0_3\020\003\022\n\n\006_0_" + "1_0\020\004\"\231\014\n\010Language\022\024\n\020UNKNOWN_LANGUAGE\020\000" + "\022\006\n\002en\020\001\022\006\n\002aa\020\002\022\006\n\002ab\020\003\022\006\n\002ae\020\004\022\006\n\002af\020\005" + "\022\006\n\002ak\020\006\022\006\n\002am\020\007\022\006\n\002an\020\010\022\006\n\002ar\020\t\022\006\n\002as\020\n" + "\022\006\n\002av\020\013\022\006\n\002ay\020\014\022\006\n\002az\020\r\022\006\n\002ba\020\016\022\006\n\002be\020\017" + "\022\006\n\002bg\020\020\022\006\n\002bh\020\021\022\006\n\002bi\020\022\022\006\n\002bm\020\023\022\006\n\002bn\020\024" + "\022\006\n\002bo\020\025\022\006\n\002br\020\026\022\006\n\002bs\020\027\022\006\n\002ca\020\030\022\006\n\002ce\020\031" + "\022\006\n\002ch\020\032\022\006\n\002co\020\033\022\006\n\002cr\020\034\022\006\n\002cs\020\035\022\006\n\002cu\020\036" + "\022\006\n\002cv\020\037\022\006\n\002cy\020 \022\006\n\002da\020!\022\006\n\002de\020\"\022\006\n\002dv\020#" + "\022\006\n\002dz\020$\022\006\n\002ee\020%\022\006\n\002el\020&\022\006\n\002eo\020\'\022\006\n\002es\020(" + "\022\006\n\002et\020)\022\006\n\002eu\020*\022\006\n\002fa\020+\022\006\n\002ff\020,\022\006\n\002fi\020-" + "\022\006\n\002fj\020.\022\006\n\002fo\020/\022\006\n\002fr\0200\022\006\n\002fy\0201\022\006\n\002ga\0202" + "\022\006\n\002gd\0203\022\006\n\002gl\0204\022\006\n\002gn\0205\022\006\n\002gu\0206\022\006\n\002gv\0207" + "\022\006\n\002ha\0208\022\006\n\002he\0209\022\006\n\002hi\020:\022\006\n\002ho\020;\022\006\n\002hr\020<" + "\022\006\n\002ht\020=\022\006\n\002hu\020>\022\006\n\002hy\020\?\022\006\n\002hz\020@\022\006\n\002ia\020A" + "\022\006\n\002id\020B\022\006\n\002ie\020C\022\006\n\002ig\020D\022\006\n\002ii\020E\022\006\n\002ik\020F" + "\022\006\n\002io\020G\022\006\n\002is\020H\022\006\n\002it\020I\022\006\n\002iu\020J\022\006\n\002ja\020K" + "\022\006\n\002jv\020L\022\006\n\002ka\020M\022\006\n\002kg\020N\022\006\n\002ki\020O\022\006\n\002kj\020P" + "\022\006\n\002kk\020Q\022\006\n\002kl\020R\022\006\n\002km\020S\022\006\n\002kn\020T\022\006\n\002ko\020U" + "\022\006\n\002kr\020V\022\006\n\002ks\020W\022\006\n\002ku\020X\022\006\n\002kv\020Y\022\006\n\002kw\020Z" + "\022\006\n\002ky\020[\022\006\n\002la\020\\\022\006\n\002lb\020]\022\006\n\002lg\020^\022\006\n\002li\020_" + "\022\006\n\002ln\020`\022\006\n\002lo\020a\022\006\n\002lt\020b\022\006\n\002lu\020c\022\006\n\002lv\020d" + "\022\006\n\002mg\020e\022\006\n\002mh\020f\022\006\n\002mi\020g\022\006\n\002mk\020h\022\006\n\002ml\020i" + "\022\006\n\002mn\020j\022\006\n\002mr\020k\022\006\n\002ms\020l\022\006\n\002mt\020m\022\006\n\002my\020n" + "\022\006\n\002na\020o\022\006\n\002nb\020p\022\006\n\002nd\020q\022\006\n\002ne\020r\022\006\n\002ng\020s" + "\022\006\n\002nl\020t\022\006\n\002nn\020u\022\006\n\002no\020v\022\006\n\002nr\020w\022\006\n\002nv\020x" + "\022\006\n\002ny\020y\022\006\n\002oc\020z\022\006\n\002oj\020{\022\006\n\002om\020|\022\006\n\002or\020}" + "\022\006\n\002os\020~\022\006\n\002pa\020\177\022\007\n\002pi\020\200\001\022\007\n\002pl\020\201\001\022\007\n\002ps" + "\020\202\001\022\007\n\002pt\020\203\001\022\007\n\002qu\020\204\001\022\007\n\002rm\020\205\001\022\007\n\002rn\020\206\001\022" + "\007\n\002ro\020\207\001\022\007\n\002ru\020\210\001\022\007\n\002rw\020\211\001\022\007\n\002sa\020\212\001\022\007\n\002s" + "c\020\213\001\022\007\n\002sd\020\214\001\022\007\n\002se\020\215\001\022\007\n\002sg\020\216\001\022\007\n\002si\020\217\001" + "\022\007\n\002sk\020\220\001\022\007\n\002sl\020\221\001\022\007\n\002sm\020\222\001\022\007\n\002sn\020\223\001\022\007\n\002" + "so\020\224\001\022\007\n\002sq\020\225\001\022\007\n\002sr\020\226\001\022\007\n\002ss\020\227\001\022\007\n\002st\020\230" + "\001\022\007\n\002su\020\231\001\022\007\n\002sv\020\232\001\022\007\n\002sw\020\233\001\022\007\n\002ta\020\234\001\022\007\n" + "\002te\020\235\001\022\007\n\002tg\020\236\001\022\007\n\002th\020\237\001\022\007\n\002ti\020\240\001\022\007\n\002tk\020" + "\241\001\022\007\n\002tl\020\242\001\022\007\n\002tn\020\243\001\022\007\n\002to\020\244\001\022\007\n\002tr\020\245\001\022\007" + "\n\002ts\020\246\001\022\007\n\002tt\020\247\001\022\007\n\002tw\020\250\001\022\007\n\002ty\020\251\001\022\007\n\002ug" + "\020\252\001\022\007\n\002uk\020\253\001\022\007\n\002ur\020\254\001\022\007\n\002uz\020\255\001\022\007\n\002ve\020\256\001\022" + "\007\n\002vi\020\257\001\022\007\n\002vo\020\260\001\022\007\n\002wa\020\261\001\022\007\n\002wo\020\262\001\022\007\n\002x" + "h\020\263\001\022\007\n\002yi\020\264\001\022\007\n\002yo\020\265\001\022\007\n\002za\020\266\001\022\007\n\002zh\020\267\001" + "\022\007\n\002zu\020\270\001" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 1929); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "metadata.proto", &protobuf_RegisterTypes); + ::protobuf_fee_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_metadata_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Metadata_Version_descriptor() { + protobuf_metadata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_metadata_2eproto::file_level_enum_descriptors[0]; +} +bool Metadata_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Metadata_Version Metadata::UNKNOWN_VERSION; +const Metadata_Version Metadata::_0_0_1; +const Metadata_Version Metadata::_0_0_2; +const Metadata_Version Metadata::_0_0_3; +const Metadata_Version Metadata::_0_1_0; +const Metadata_Version Metadata::Version_MIN; +const Metadata_Version Metadata::Version_MAX; +const int Metadata::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* Metadata_Language_descriptor() { + protobuf_metadata_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_metadata_2eproto::file_level_enum_descriptors[1]; +} +bool Metadata_Language_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 137: + case 138: + case 139: + case 140: + case 141: + case 142: + case 143: + case 144: + case 145: + case 146: + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 157: + case 158: + case 159: + case 160: + case 161: + case 162: + case 163: + case 164: + case 165: + case 166: + case 167: + case 168: + case 169: + case 170: + case 171: + case 172: + case 173: + case 174: + case 175: + case 176: + case 177: + case 178: + case 179: + case 180: + case 181: + case 182: + case 183: + case 184: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Metadata_Language Metadata::UNKNOWN_LANGUAGE; +const Metadata_Language Metadata::en; +const Metadata_Language Metadata::aa; +const Metadata_Language Metadata::ab; +const Metadata_Language Metadata::ae; +const Metadata_Language Metadata::af; +const Metadata_Language Metadata::ak; +const Metadata_Language Metadata::am; +const Metadata_Language Metadata::an; +const Metadata_Language Metadata::ar; +const Metadata_Language Metadata::as; +const Metadata_Language Metadata::av; +const Metadata_Language Metadata::ay; +const Metadata_Language Metadata::az; +const Metadata_Language Metadata::ba; +const Metadata_Language Metadata::be; +const Metadata_Language Metadata::bg; +const Metadata_Language Metadata::bh; +const Metadata_Language Metadata::bi; +const Metadata_Language Metadata::bm; +const Metadata_Language Metadata::bn; +const Metadata_Language Metadata::bo; +const Metadata_Language Metadata::br; +const Metadata_Language Metadata::bs; +const Metadata_Language Metadata::ca; +const Metadata_Language Metadata::ce; +const Metadata_Language Metadata::ch; +const Metadata_Language Metadata::co; +const Metadata_Language Metadata::cr; +const Metadata_Language Metadata::cs; +const Metadata_Language Metadata::cu; +const Metadata_Language Metadata::cv; +const Metadata_Language Metadata::cy; +const Metadata_Language Metadata::da; +const Metadata_Language Metadata::de; +const Metadata_Language Metadata::dv; +const Metadata_Language Metadata::dz; +const Metadata_Language Metadata::ee; +const Metadata_Language Metadata::el; +const Metadata_Language Metadata::eo; +const Metadata_Language Metadata::es; +const Metadata_Language Metadata::et; +const Metadata_Language Metadata::eu; +const Metadata_Language Metadata::fa; +const Metadata_Language Metadata::ff; +const Metadata_Language Metadata::fi; +const Metadata_Language Metadata::fj; +const Metadata_Language Metadata::fo; +const Metadata_Language Metadata::fr; +const Metadata_Language Metadata::fy; +const Metadata_Language Metadata::ga; +const Metadata_Language Metadata::gd; +const Metadata_Language Metadata::gl; +const Metadata_Language Metadata::gn; +const Metadata_Language Metadata::gu; +const Metadata_Language Metadata::gv; +const Metadata_Language Metadata::ha; +const Metadata_Language Metadata::he; +const Metadata_Language Metadata::hi; +const Metadata_Language Metadata::ho; +const Metadata_Language Metadata::hr; +const Metadata_Language Metadata::ht; +const Metadata_Language Metadata::hu; +const Metadata_Language Metadata::hy; +const Metadata_Language Metadata::hz; +const Metadata_Language Metadata::ia; +const Metadata_Language Metadata::id; +const Metadata_Language Metadata::ie; +const Metadata_Language Metadata::ig; +const Metadata_Language Metadata::ii; +const Metadata_Language Metadata::ik; +const Metadata_Language Metadata::io; +const Metadata_Language Metadata::is; +const Metadata_Language Metadata::it; +const Metadata_Language Metadata::iu; +const Metadata_Language Metadata::ja; +const Metadata_Language Metadata::jv; +const Metadata_Language Metadata::ka; +const Metadata_Language Metadata::kg; +const Metadata_Language Metadata::ki; +const Metadata_Language Metadata::kj; +const Metadata_Language Metadata::kk; +const Metadata_Language Metadata::kl; +const Metadata_Language Metadata::km; +const Metadata_Language Metadata::kn; +const Metadata_Language Metadata::ko; +const Metadata_Language Metadata::kr; +const Metadata_Language Metadata::ks; +const Metadata_Language Metadata::ku; +const Metadata_Language Metadata::kv; +const Metadata_Language Metadata::kw; +const Metadata_Language Metadata::ky; +const Metadata_Language Metadata::la; +const Metadata_Language Metadata::lb; +const Metadata_Language Metadata::lg; +const Metadata_Language Metadata::li; +const Metadata_Language Metadata::ln; +const Metadata_Language Metadata::lo; +const Metadata_Language Metadata::lt; +const Metadata_Language Metadata::lu; +const Metadata_Language Metadata::lv; +const Metadata_Language Metadata::mg; +const Metadata_Language Metadata::mh; +const Metadata_Language Metadata::mi; +const Metadata_Language Metadata::mk; +const Metadata_Language Metadata::ml; +const Metadata_Language Metadata::mn; +const Metadata_Language Metadata::mr; +const Metadata_Language Metadata::ms; +const Metadata_Language Metadata::mt; +const Metadata_Language Metadata::my; +const Metadata_Language Metadata::na; +const Metadata_Language Metadata::nb; +const Metadata_Language Metadata::nd; +const Metadata_Language Metadata::ne; +const Metadata_Language Metadata::ng; +const Metadata_Language Metadata::nl; +const Metadata_Language Metadata::nn; +const Metadata_Language Metadata::no; +const Metadata_Language Metadata::nr; +const Metadata_Language Metadata::nv; +const Metadata_Language Metadata::ny; +const Metadata_Language Metadata::oc; +const Metadata_Language Metadata::oj; +const Metadata_Language Metadata::om; +const Metadata_Language Metadata::or_; +const Metadata_Language Metadata::os; +const Metadata_Language Metadata::pa; +const Metadata_Language Metadata::pi; +const Metadata_Language Metadata::pl; +const Metadata_Language Metadata::ps; +const Metadata_Language Metadata::pt; +const Metadata_Language Metadata::qu; +const Metadata_Language Metadata::rm; +const Metadata_Language Metadata::rn; +const Metadata_Language Metadata::ro; +const Metadata_Language Metadata::ru; +const Metadata_Language Metadata::rw; +const Metadata_Language Metadata::sa; +const Metadata_Language Metadata::sc; +const Metadata_Language Metadata::sd; +const Metadata_Language Metadata::se; +const Metadata_Language Metadata::sg; +const Metadata_Language Metadata::si; +const Metadata_Language Metadata::sk; +const Metadata_Language Metadata::sl; +const Metadata_Language Metadata::sm; +const Metadata_Language Metadata::sn; +const Metadata_Language Metadata::so; +const Metadata_Language Metadata::sq; +const Metadata_Language Metadata::sr; +const Metadata_Language Metadata::ss; +const Metadata_Language Metadata::st; +const Metadata_Language Metadata::su; +const Metadata_Language Metadata::sv; +const Metadata_Language Metadata::sw; +const Metadata_Language Metadata::ta; +const Metadata_Language Metadata::te; +const Metadata_Language Metadata::tg; +const Metadata_Language Metadata::th; +const Metadata_Language Metadata::ti; +const Metadata_Language Metadata::tk; +const Metadata_Language Metadata::tl; +const Metadata_Language Metadata::tn; +const Metadata_Language Metadata::to; +const Metadata_Language Metadata::tr; +const Metadata_Language Metadata::ts; +const Metadata_Language Metadata::tt; +const Metadata_Language Metadata::tw; +const Metadata_Language Metadata::ty; +const Metadata_Language Metadata::ug; +const Metadata_Language Metadata::uk; +const Metadata_Language Metadata::ur; +const Metadata_Language Metadata::uz; +const Metadata_Language Metadata::ve; +const Metadata_Language Metadata::vi; +const Metadata_Language Metadata::vo; +const Metadata_Language Metadata::wa; +const Metadata_Language Metadata::wo; +const Metadata_Language Metadata::xh; +const Metadata_Language Metadata::yi; +const Metadata_Language Metadata::yo; +const Metadata_Language Metadata::za; +const Metadata_Language Metadata::zh; +const Metadata_Language Metadata::zu; +const Metadata_Language Metadata::Language_MIN; +const Metadata_Language Metadata::Language_MAX; +const int Metadata::Language_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Metadata::InitAsDefaultInstance() { + ::pb::_Metadata_default_instance_._instance.get_mutable()->fee_ = const_cast< ::pb::Fee*>( + ::pb::Fee::internal_default_instance()); +} +void Metadata::clear_fee() { + if (fee_ != NULL) fee_->Clear(); + clear_has_fee(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Metadata::kVersionFieldNumber; +const int Metadata::kLanguageFieldNumber; +const int Metadata::kTitleFieldNumber; +const int Metadata::kDescriptionFieldNumber; +const int Metadata::kAuthorFieldNumber; +const int Metadata::kLicenseFieldNumber; +const int Metadata::kNsfwFieldNumber; +const int Metadata::kFeeFieldNumber; +const int Metadata::kThumbnailFieldNumber; +const int Metadata::kPreviewFieldNumber; +const int Metadata::kLicenseUrlFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Metadata::Metadata() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_metadata_2eproto::scc_info_Metadata.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Metadata) +} +Metadata::Metadata(const Metadata& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + title_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_title()) { + title_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.title_); + } + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_description()) { + description_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description_); + } + author_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_author()) { + author_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.author_); + } + license_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_license()) { + license_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.license_); + } + thumbnail_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_thumbnail()) { + thumbnail_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.thumbnail_); + } + preview_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_preview()) { + preview_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.preview_); + } + licenseurl_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_licenseurl()) { + licenseurl_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.licenseurl_); + } + if (from.has_fee()) { + fee_ = new ::pb::Fee(*from.fee_); + } else { + fee_ = NULL; + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&nsfw_) - + reinterpret_cast(&version_)) + sizeof(nsfw_)); + // @@protoc_insertion_point(copy_constructor:pb.Metadata) +} + +void Metadata::SharedCtor() { + title_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + author_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + license_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + thumbnail_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + preview_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + licenseurl_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&fee_, 0, static_cast( + reinterpret_cast(&nsfw_) - + reinterpret_cast(&fee_)) + sizeof(nsfw_)); +} + +Metadata::~Metadata() { + // @@protoc_insertion_point(destructor:pb.Metadata) + SharedDtor(); +} + +void Metadata::SharedDtor() { + title_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + author_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + license_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + thumbnail_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + preview_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + licenseurl_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete fee_; +} + +void Metadata::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Metadata::descriptor() { + ::protobuf_metadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_metadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Metadata& Metadata::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_metadata_2eproto::scc_info_Metadata.base); + return *internal_default_instance(); +} + + +void Metadata::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Metadata) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 255u) { + if (cached_has_bits & 0x00000001u) { + title_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + description_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000004u) { + author_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000008u) { + license_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000010u) { + thumbnail_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000020u) { + preview_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000040u) { + licenseurl_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000080u) { + GOOGLE_DCHECK(fee_ != NULL); + fee_->Clear(); + } + } + if (cached_has_bits & 1792u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&nsfw_) - + reinterpret_cast(&version_)) + sizeof(nsfw_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Metadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Metadata) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Metadata.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Metadata_Version_IsValid(value)) { + set_version(static_cast< ::pb::Metadata_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Metadata.Language language = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Metadata_Language_IsValid(value)) { + set_language(static_cast< ::pb::Metadata_Language >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required string title = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_title())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->title().data(), static_cast(this->title().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.title"); + } else { + goto handle_unusual; + } + break; + } + + // required string description = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.description"); + } else { + goto handle_unusual; + } + break; + } + + // required string author = 5; + case 5: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_author())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->author().data(), static_cast(this->author().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.author"); + } else { + goto handle_unusual; + } + break; + } + + // required string license = 6; + case 6: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_license())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->license().data(), static_cast(this->license().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.license"); + } else { + goto handle_unusual; + } + break; + } + + // required bool nsfw = 7; + case 7: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) { + set_has_nsfw(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &nsfw_))); + } else { + goto handle_unusual; + } + break; + } + + // optional .pb.Fee fee = 8; + case 8: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_fee())); + } else { + goto handle_unusual; + } + break; + } + + // optional string thumbnail = 9; + case 9: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_thumbnail())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->thumbnail().data(), static_cast(this->thumbnail().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.thumbnail"); + } else { + goto handle_unusual; + } + break; + } + + // optional string preview = 10; + case 10: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_preview())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->preview().data(), static_cast(this->preview().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.preview"); + } else { + goto handle_unusual; + } + break; + } + + // optional string licenseUrl = 11; + case 11: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_licenseurl())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->licenseurl().data(), static_cast(this->licenseurl().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Metadata.licenseUrl"); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Metadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Metadata) + return false; +#undef DO_ +} + +void Metadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Metadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Metadata.Version version = 1; + if (cached_has_bits & 0x00000100u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.Metadata.Language language = 2; + if (cached_has_bits & 0x00000200u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->language(), output); + } + + // required string title = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->title().data(), static_cast(this->title().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.title"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->title(), output); + } + + // required string description = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.description"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->description(), output); + } + + // required string author = 5; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->author().data(), static_cast(this->author().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.author"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->author(), output); + } + + // required string license = 6; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->license().data(), static_cast(this->license().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.license"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->license(), output); + } + + // required bool nsfw = 7; + if (cached_has_bits & 0x00000400u) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->nsfw(), output); + } + + // optional .pb.Fee fee = 8; + if (cached_has_bits & 0x00000080u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->_internal_fee(), output); + } + + // optional string thumbnail = 9; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->thumbnail().data(), static_cast(this->thumbnail().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.thumbnail"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->thumbnail(), output); + } + + // optional string preview = 10; + if (cached_has_bits & 0x00000020u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->preview().data(), static_cast(this->preview().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.preview"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 10, this->preview(), output); + } + + // optional string licenseUrl = 11; + if (cached_has_bits & 0x00000040u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->licenseurl().data(), static_cast(this->licenseurl().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.licenseUrl"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->licenseurl(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Metadata) +} + +::google::protobuf::uint8* Metadata::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Metadata) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Metadata.Version version = 1; + if (cached_has_bits & 0x00000100u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.Metadata.Language language = 2; + if (cached_has_bits & 0x00000200u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->language(), target); + } + + // required string title = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->title().data(), static_cast(this->title().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.title"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->title(), target); + } + + // required string description = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->description().data(), static_cast(this->description().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.description"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->description(), target); + } + + // required string author = 5; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->author().data(), static_cast(this->author().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.author"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 5, this->author(), target); + } + + // required string license = 6; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->license().data(), static_cast(this->license().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.license"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->license(), target); + } + + // required bool nsfw = 7; + if (cached_has_bits & 0x00000400u) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->nsfw(), target); + } + + // optional .pb.Fee fee = 8; + if (cached_has_bits & 0x00000080u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 8, this->_internal_fee(), deterministic, target); + } + + // optional string thumbnail = 9; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->thumbnail().data(), static_cast(this->thumbnail().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.thumbnail"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 9, this->thumbnail(), target); + } + + // optional string preview = 10; + if (cached_has_bits & 0x00000020u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->preview().data(), static_cast(this->preview().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.preview"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 10, this->preview(), target); + } + + // optional string licenseUrl = 11; + if (cached_has_bits & 0x00000040u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->licenseurl().data(), static_cast(this->licenseurl().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Metadata.licenseUrl"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->licenseurl(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Metadata) + return target; +} + +size_t Metadata::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Metadata) + size_t total_size = 0; + + if (has_title()) { + // required string title = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->title()); + } + + if (has_description()) { + // required string description = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + if (has_author()) { + // required string author = 5; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->author()); + } + + if (has_license()) { + // required string license = 6; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->license()); + } + + if (has_version()) { + // required .pb.Metadata.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_language()) { + // required .pb.Metadata.Language language = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->language()); + } + + if (has_nsfw()) { + // required bool nsfw = 7; + total_size += 1 + 1; + } + + return total_size; +} +size_t Metadata::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Metadata) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x0000070f) ^ 0x0000070f) == 0) { // All required fields are present. + // required string title = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->title()); + + // required string description = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + + // required string author = 5; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->author()); + + // required string license = 6; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->license()); + + // required .pb.Metadata.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.Metadata.Language language = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->language()); + + // required bool nsfw = 7; + total_size += 1 + 1; + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + if (_has_bits_[0 / 32] & 240u) { + // optional string thumbnail = 9; + if (has_thumbnail()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->thumbnail()); + } + + // optional string preview = 10; + if (has_preview()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->preview()); + } + + // optional string licenseUrl = 11; + if (has_licenseurl()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->licenseurl()); + } + + // optional .pb.Fee fee = 8; + if (has_fee()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *fee_); + } + + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Metadata::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Metadata) + GOOGLE_DCHECK_NE(&from, this); + const Metadata* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Metadata) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Metadata) + MergeFrom(*source); + } +} + +void Metadata::MergeFrom(const Metadata& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Metadata) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 255u) { + if (cached_has_bits & 0x00000001u) { + set_has_title(); + title_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.title_); + } + if (cached_has_bits & 0x00000002u) { + set_has_description(); + description_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.description_); + } + if (cached_has_bits & 0x00000004u) { + set_has_author(); + author_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.author_); + } + if (cached_has_bits & 0x00000008u) { + set_has_license(); + license_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.license_); + } + if (cached_has_bits & 0x00000010u) { + set_has_thumbnail(); + thumbnail_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.thumbnail_); + } + if (cached_has_bits & 0x00000020u) { + set_has_preview(); + preview_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.preview_); + } + if (cached_has_bits & 0x00000040u) { + set_has_licenseurl(); + licenseurl_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.licenseurl_); + } + if (cached_has_bits & 0x00000080u) { + mutable_fee()->::pb::Fee::MergeFrom(from.fee()); + } + } + if (cached_has_bits & 1792u) { + if (cached_has_bits & 0x00000100u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000200u) { + language_ = from.language_; + } + if (cached_has_bits & 0x00000400u) { + nsfw_ = from.nsfw_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Metadata::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Metadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Metadata::CopyFrom(const Metadata& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Metadata) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Metadata::IsInitialized() const { + if ((_has_bits_[0] & 0x0000070f) != 0x0000070f) return false; + if (has_fee()) { + if (!this->fee_->IsInitialized()) return false; + } + return true; +} + +void Metadata::Swap(Metadata* other) { + if (other == this) return; + InternalSwap(other); +} +void Metadata::InternalSwap(Metadata* other) { + using std::swap; + title_.Swap(&other->title_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + description_.Swap(&other->description_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + author_.Swap(&other->author_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + license_.Swap(&other->license_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + thumbnail_.Swap(&other->thumbnail_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + preview_.Swap(&other->preview_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + licenseurl_.Swap(&other->licenseurl_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(fee_, other->fee_); + swap(version_, other->version_); + swap(language_, other->language_); + swap(nsfw_, other->nsfw_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Metadata::GetMetadata() const { + protobuf_metadata_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_metadata_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Metadata* Arena::CreateMaybeMessage< ::pb::Metadata >(Arena* arena) { + return Arena::CreateInternal< ::pb::Metadata >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/metadata.pb.h b/cpp/metadata.pb.h new file mode 100644 index 0000000..e028e81 --- /dev/null +++ b/cpp/metadata.pb.h @@ -0,0 +1,1616 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: metadata.proto + +#ifndef PROTOBUF_INCLUDED_metadata_2eproto +#define PROTOBUF_INCLUDED_metadata_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "fee.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_metadata_2eproto + +namespace protobuf_metadata_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_metadata_2eproto +namespace pb { +class Metadata; +class MetadataDefaultTypeInternal; +extern MetadataDefaultTypeInternal _Metadata_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Metadata* Arena::CreateMaybeMessage<::pb::Metadata>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Metadata_Version { + Metadata_Version_UNKNOWN_VERSION = 0, + Metadata_Version__0_0_1 = 1, + Metadata_Version__0_0_2 = 2, + Metadata_Version__0_0_3 = 3, + Metadata_Version__0_1_0 = 4 +}; +bool Metadata_Version_IsValid(int value); +const Metadata_Version Metadata_Version_Version_MIN = Metadata_Version_UNKNOWN_VERSION; +const Metadata_Version Metadata_Version_Version_MAX = Metadata_Version__0_1_0; +const int Metadata_Version_Version_ARRAYSIZE = Metadata_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Metadata_Version_descriptor(); +inline const ::std::string& Metadata_Version_Name(Metadata_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Metadata_Version_descriptor(), value); +} +inline bool Metadata_Version_Parse( + const ::std::string& name, Metadata_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Metadata_Version_descriptor(), name, value); +} +enum Metadata_Language { + Metadata_Language_UNKNOWN_LANGUAGE = 0, + Metadata_Language_en = 1, + Metadata_Language_aa = 2, + Metadata_Language_ab = 3, + Metadata_Language_ae = 4, + Metadata_Language_af = 5, + Metadata_Language_ak = 6, + Metadata_Language_am = 7, + Metadata_Language_an = 8, + Metadata_Language_ar = 9, + Metadata_Language_as = 10, + Metadata_Language_av = 11, + Metadata_Language_ay = 12, + Metadata_Language_az = 13, + Metadata_Language_ba = 14, + Metadata_Language_be = 15, + Metadata_Language_bg = 16, + Metadata_Language_bh = 17, + Metadata_Language_bi = 18, + Metadata_Language_bm = 19, + Metadata_Language_bn = 20, + Metadata_Language_bo = 21, + Metadata_Language_br = 22, + Metadata_Language_bs = 23, + Metadata_Language_ca = 24, + Metadata_Language_ce = 25, + Metadata_Language_ch = 26, + Metadata_Language_co = 27, + Metadata_Language_cr = 28, + Metadata_Language_cs = 29, + Metadata_Language_cu = 30, + Metadata_Language_cv = 31, + Metadata_Language_cy = 32, + Metadata_Language_da = 33, + Metadata_Language_de = 34, + Metadata_Language_dv = 35, + Metadata_Language_dz = 36, + Metadata_Language_ee = 37, + Metadata_Language_el = 38, + Metadata_Language_eo = 39, + Metadata_Language_es = 40, + Metadata_Language_et = 41, + Metadata_Language_eu = 42, + Metadata_Language_fa = 43, + Metadata_Language_ff = 44, + Metadata_Language_fi = 45, + Metadata_Language_fj = 46, + Metadata_Language_fo = 47, + Metadata_Language_fr = 48, + Metadata_Language_fy = 49, + Metadata_Language_ga = 50, + Metadata_Language_gd = 51, + Metadata_Language_gl = 52, + Metadata_Language_gn = 53, + Metadata_Language_gu = 54, + Metadata_Language_gv = 55, + Metadata_Language_ha = 56, + Metadata_Language_he = 57, + Metadata_Language_hi = 58, + Metadata_Language_ho = 59, + Metadata_Language_hr = 60, + Metadata_Language_ht = 61, + Metadata_Language_hu = 62, + Metadata_Language_hy = 63, + Metadata_Language_hz = 64, + Metadata_Language_ia = 65, + Metadata_Language_id = 66, + Metadata_Language_ie = 67, + Metadata_Language_ig = 68, + Metadata_Language_ii = 69, + Metadata_Language_ik = 70, + Metadata_Language_io = 71, + Metadata_Language_is = 72, + Metadata_Language_it = 73, + Metadata_Language_iu = 74, + Metadata_Language_ja = 75, + Metadata_Language_jv = 76, + Metadata_Language_ka = 77, + Metadata_Language_kg = 78, + Metadata_Language_ki = 79, + Metadata_Language_kj = 80, + Metadata_Language_kk = 81, + Metadata_Language_kl = 82, + Metadata_Language_km = 83, + Metadata_Language_kn = 84, + Metadata_Language_ko = 85, + Metadata_Language_kr = 86, + Metadata_Language_ks = 87, + Metadata_Language_ku = 88, + Metadata_Language_kv = 89, + Metadata_Language_kw = 90, + Metadata_Language_ky = 91, + Metadata_Language_la = 92, + Metadata_Language_lb = 93, + Metadata_Language_lg = 94, + Metadata_Language_li = 95, + Metadata_Language_ln = 96, + Metadata_Language_lo = 97, + Metadata_Language_lt = 98, + Metadata_Language_lu = 99, + Metadata_Language_lv = 100, + Metadata_Language_mg = 101, + Metadata_Language_mh = 102, + Metadata_Language_mi = 103, + Metadata_Language_mk = 104, + Metadata_Language_ml = 105, + Metadata_Language_mn = 106, + Metadata_Language_mr = 107, + Metadata_Language_ms = 108, + Metadata_Language_mt = 109, + Metadata_Language_my = 110, + Metadata_Language_na = 111, + Metadata_Language_nb = 112, + Metadata_Language_nd = 113, + Metadata_Language_ne = 114, + Metadata_Language_ng = 115, + Metadata_Language_nl = 116, + Metadata_Language_nn = 117, + Metadata_Language_no = 118, + Metadata_Language_nr = 119, + Metadata_Language_nv = 120, + Metadata_Language_ny = 121, + Metadata_Language_oc = 122, + Metadata_Language_oj = 123, + Metadata_Language_om = 124, + Metadata_Language_or_ = 125, + Metadata_Language_os = 126, + Metadata_Language_pa = 127, + Metadata_Language_pi = 128, + Metadata_Language_pl = 129, + Metadata_Language_ps = 130, + Metadata_Language_pt = 131, + Metadata_Language_qu = 132, + Metadata_Language_rm = 133, + Metadata_Language_rn = 134, + Metadata_Language_ro = 135, + Metadata_Language_ru = 136, + Metadata_Language_rw = 137, + Metadata_Language_sa = 138, + Metadata_Language_sc = 139, + Metadata_Language_sd = 140, + Metadata_Language_se = 141, + Metadata_Language_sg = 142, + Metadata_Language_si = 143, + Metadata_Language_sk = 144, + Metadata_Language_sl = 145, + Metadata_Language_sm = 146, + Metadata_Language_sn = 147, + Metadata_Language_so = 148, + Metadata_Language_sq = 149, + Metadata_Language_sr = 150, + Metadata_Language_ss = 151, + Metadata_Language_st = 152, + Metadata_Language_su = 153, + Metadata_Language_sv = 154, + Metadata_Language_sw = 155, + Metadata_Language_ta = 156, + Metadata_Language_te = 157, + Metadata_Language_tg = 158, + Metadata_Language_th = 159, + Metadata_Language_ti = 160, + Metadata_Language_tk = 161, + Metadata_Language_tl = 162, + Metadata_Language_tn = 163, + Metadata_Language_to = 164, + Metadata_Language_tr = 165, + Metadata_Language_ts = 166, + Metadata_Language_tt = 167, + Metadata_Language_tw = 168, + Metadata_Language_ty = 169, + Metadata_Language_ug = 170, + Metadata_Language_uk = 171, + Metadata_Language_ur = 172, + Metadata_Language_uz = 173, + Metadata_Language_ve = 174, + Metadata_Language_vi = 175, + Metadata_Language_vo = 176, + Metadata_Language_wa = 177, + Metadata_Language_wo = 178, + Metadata_Language_xh = 179, + Metadata_Language_yi = 180, + Metadata_Language_yo = 181, + Metadata_Language_za = 182, + Metadata_Language_zh = 183, + Metadata_Language_zu = 184 +}; +bool Metadata_Language_IsValid(int value); +const Metadata_Language Metadata_Language_Language_MIN = Metadata_Language_UNKNOWN_LANGUAGE; +const Metadata_Language Metadata_Language_Language_MAX = Metadata_Language_zu; +const int Metadata_Language_Language_ARRAYSIZE = Metadata_Language_Language_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Metadata_Language_descriptor(); +inline const ::std::string& Metadata_Language_Name(Metadata_Language value) { + return ::google::protobuf::internal::NameOfEnum( + Metadata_Language_descriptor(), value); +} +inline bool Metadata_Language_Parse( + const ::std::string& name, Metadata_Language* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Metadata_Language_descriptor(), name, value); +} +// =================================================================== + +class Metadata : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Metadata) */ { + public: + Metadata(); + virtual ~Metadata(); + + Metadata(const Metadata& from); + + inline Metadata& operator=(const Metadata& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Metadata(Metadata&& from) noexcept + : Metadata() { + *this = ::std::move(from); + } + + inline Metadata& operator=(Metadata&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Metadata& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Metadata* internal_default_instance() { + return reinterpret_cast( + &_Metadata_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Metadata* other); + friend void swap(Metadata& a, Metadata& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Metadata* New() const final { + return CreateMaybeMessage(NULL); + } + + Metadata* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Metadata& from); + void MergeFrom(const Metadata& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Metadata* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Metadata_Version Version; + static const Version UNKNOWN_VERSION = + Metadata_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Metadata_Version__0_0_1; + static const Version _0_0_2 = + Metadata_Version__0_0_2; + static const Version _0_0_3 = + Metadata_Version__0_0_3; + static const Version _0_1_0 = + Metadata_Version__0_1_0; + static inline bool Version_IsValid(int value) { + return Metadata_Version_IsValid(value); + } + static const Version Version_MIN = + Metadata_Version_Version_MIN; + static const Version Version_MAX = + Metadata_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Metadata_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Metadata_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Metadata_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Metadata_Version_Parse(name, value); + } + + typedef Metadata_Language Language; + static const Language UNKNOWN_LANGUAGE = + Metadata_Language_UNKNOWN_LANGUAGE; + static const Language en = + Metadata_Language_en; + static const Language aa = + Metadata_Language_aa; + static const Language ab = + Metadata_Language_ab; + static const Language ae = + Metadata_Language_ae; + static const Language af = + Metadata_Language_af; + static const Language ak = + Metadata_Language_ak; + static const Language am = + Metadata_Language_am; + static const Language an = + Metadata_Language_an; + static const Language ar = + Metadata_Language_ar; + static const Language as = + Metadata_Language_as; + static const Language av = + Metadata_Language_av; + static const Language ay = + Metadata_Language_ay; + static const Language az = + Metadata_Language_az; + static const Language ba = + Metadata_Language_ba; + static const Language be = + Metadata_Language_be; + static const Language bg = + Metadata_Language_bg; + static const Language bh = + Metadata_Language_bh; + static const Language bi = + Metadata_Language_bi; + static const Language bm = + Metadata_Language_bm; + static const Language bn = + Metadata_Language_bn; + static const Language bo = + Metadata_Language_bo; + static const Language br = + Metadata_Language_br; + static const Language bs = + Metadata_Language_bs; + static const Language ca = + Metadata_Language_ca; + static const Language ce = + Metadata_Language_ce; + static const Language ch = + Metadata_Language_ch; + static const Language co = + Metadata_Language_co; + static const Language cr = + Metadata_Language_cr; + static const Language cs = + Metadata_Language_cs; + static const Language cu = + Metadata_Language_cu; + static const Language cv = + Metadata_Language_cv; + static const Language cy = + Metadata_Language_cy; + static const Language da = + Metadata_Language_da; + static const Language de = + Metadata_Language_de; + static const Language dv = + Metadata_Language_dv; + static const Language dz = + Metadata_Language_dz; + static const Language ee = + Metadata_Language_ee; + static const Language el = + Metadata_Language_el; + static const Language eo = + Metadata_Language_eo; + static const Language es = + Metadata_Language_es; + static const Language et = + Metadata_Language_et; + static const Language eu = + Metadata_Language_eu; + static const Language fa = + Metadata_Language_fa; + static const Language ff = + Metadata_Language_ff; + static const Language fi = + Metadata_Language_fi; + static const Language fj = + Metadata_Language_fj; + static const Language fo = + Metadata_Language_fo; + static const Language fr = + Metadata_Language_fr; + static const Language fy = + Metadata_Language_fy; + static const Language ga = + Metadata_Language_ga; + static const Language gd = + Metadata_Language_gd; + static const Language gl = + Metadata_Language_gl; + static const Language gn = + Metadata_Language_gn; + static const Language gu = + Metadata_Language_gu; + static const Language gv = + Metadata_Language_gv; + static const Language ha = + Metadata_Language_ha; + static const Language he = + Metadata_Language_he; + static const Language hi = + Metadata_Language_hi; + static const Language ho = + Metadata_Language_ho; + static const Language hr = + Metadata_Language_hr; + static const Language ht = + Metadata_Language_ht; + static const Language hu = + Metadata_Language_hu; + static const Language hy = + Metadata_Language_hy; + static const Language hz = + Metadata_Language_hz; + static const Language ia = + Metadata_Language_ia; + static const Language id = + Metadata_Language_id; + static const Language ie = + Metadata_Language_ie; + static const Language ig = + Metadata_Language_ig; + static const Language ii = + Metadata_Language_ii; + static const Language ik = + Metadata_Language_ik; + static const Language io = + Metadata_Language_io; + static const Language is = + Metadata_Language_is; + static const Language it = + Metadata_Language_it; + static const Language iu = + Metadata_Language_iu; + static const Language ja = + Metadata_Language_ja; + static const Language jv = + Metadata_Language_jv; + static const Language ka = + Metadata_Language_ka; + static const Language kg = + Metadata_Language_kg; + static const Language ki = + Metadata_Language_ki; + static const Language kj = + Metadata_Language_kj; + static const Language kk = + Metadata_Language_kk; + static const Language kl = + Metadata_Language_kl; + static const Language km = + Metadata_Language_km; + static const Language kn = + Metadata_Language_kn; + static const Language ko = + Metadata_Language_ko; + static const Language kr = + Metadata_Language_kr; + static const Language ks = + Metadata_Language_ks; + static const Language ku = + Metadata_Language_ku; + static const Language kv = + Metadata_Language_kv; + static const Language kw = + Metadata_Language_kw; + static const Language ky = + Metadata_Language_ky; + static const Language la = + Metadata_Language_la; + static const Language lb = + Metadata_Language_lb; + static const Language lg = + Metadata_Language_lg; + static const Language li = + Metadata_Language_li; + static const Language ln = + Metadata_Language_ln; + static const Language lo = + Metadata_Language_lo; + static const Language lt = + Metadata_Language_lt; + static const Language lu = + Metadata_Language_lu; + static const Language lv = + Metadata_Language_lv; + static const Language mg = + Metadata_Language_mg; + static const Language mh = + Metadata_Language_mh; + static const Language mi = + Metadata_Language_mi; + static const Language mk = + Metadata_Language_mk; + static const Language ml = + Metadata_Language_ml; + static const Language mn = + Metadata_Language_mn; + static const Language mr = + Metadata_Language_mr; + static const Language ms = + Metadata_Language_ms; + static const Language mt = + Metadata_Language_mt; + static const Language my = + Metadata_Language_my; + static const Language na = + Metadata_Language_na; + static const Language nb = + Metadata_Language_nb; + static const Language nd = + Metadata_Language_nd; + static const Language ne = + Metadata_Language_ne; + static const Language ng = + Metadata_Language_ng; + static const Language nl = + Metadata_Language_nl; + static const Language nn = + Metadata_Language_nn; + static const Language no = + Metadata_Language_no; + static const Language nr = + Metadata_Language_nr; + static const Language nv = + Metadata_Language_nv; + static const Language ny = + Metadata_Language_ny; + static const Language oc = + Metadata_Language_oc; + static const Language oj = + Metadata_Language_oj; + static const Language om = + Metadata_Language_om; + static const Language or_ = + Metadata_Language_or_; + static const Language os = + Metadata_Language_os; + static const Language pa = + Metadata_Language_pa; + static const Language pi = + Metadata_Language_pi; + static const Language pl = + Metadata_Language_pl; + static const Language ps = + Metadata_Language_ps; + static const Language pt = + Metadata_Language_pt; + static const Language qu = + Metadata_Language_qu; + static const Language rm = + Metadata_Language_rm; + static const Language rn = + Metadata_Language_rn; + static const Language ro = + Metadata_Language_ro; + static const Language ru = + Metadata_Language_ru; + static const Language rw = + Metadata_Language_rw; + static const Language sa = + Metadata_Language_sa; + static const Language sc = + Metadata_Language_sc; + static const Language sd = + Metadata_Language_sd; + static const Language se = + Metadata_Language_se; + static const Language sg = + Metadata_Language_sg; + static const Language si = + Metadata_Language_si; + static const Language sk = + Metadata_Language_sk; + static const Language sl = + Metadata_Language_sl; + static const Language sm = + Metadata_Language_sm; + static const Language sn = + Metadata_Language_sn; + static const Language so = + Metadata_Language_so; + static const Language sq = + Metadata_Language_sq; + static const Language sr = + Metadata_Language_sr; + static const Language ss = + Metadata_Language_ss; + static const Language st = + Metadata_Language_st; + static const Language su = + Metadata_Language_su; + static const Language sv = + Metadata_Language_sv; + static const Language sw = + Metadata_Language_sw; + static const Language ta = + Metadata_Language_ta; + static const Language te = + Metadata_Language_te; + static const Language tg = + Metadata_Language_tg; + static const Language th = + Metadata_Language_th; + static const Language ti = + Metadata_Language_ti; + static const Language tk = + Metadata_Language_tk; + static const Language tl = + Metadata_Language_tl; + static const Language tn = + Metadata_Language_tn; + static const Language to = + Metadata_Language_to; + static const Language tr = + Metadata_Language_tr; + static const Language ts = + Metadata_Language_ts; + static const Language tt = + Metadata_Language_tt; + static const Language tw = + Metadata_Language_tw; + static const Language ty = + Metadata_Language_ty; + static const Language ug = + Metadata_Language_ug; + static const Language uk = + Metadata_Language_uk; + static const Language ur = + Metadata_Language_ur; + static const Language uz = + Metadata_Language_uz; + static const Language ve = + Metadata_Language_ve; + static const Language vi = + Metadata_Language_vi; + static const Language vo = + Metadata_Language_vo; + static const Language wa = + Metadata_Language_wa; + static const Language wo = + Metadata_Language_wo; + static const Language xh = + Metadata_Language_xh; + static const Language yi = + Metadata_Language_yi; + static const Language yo = + Metadata_Language_yo; + static const Language za = + Metadata_Language_za; + static const Language zh = + Metadata_Language_zh; + static const Language zu = + Metadata_Language_zu; + static inline bool Language_IsValid(int value) { + return Metadata_Language_IsValid(value); + } + static const Language Language_MIN = + Metadata_Language_Language_MIN; + static const Language Language_MAX = + Metadata_Language_Language_MAX; + static const int Language_ARRAYSIZE = + Metadata_Language_Language_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Language_descriptor() { + return Metadata_Language_descriptor(); + } + static inline const ::std::string& Language_Name(Language value) { + return Metadata_Language_Name(value); + } + static inline bool Language_Parse(const ::std::string& name, + Language* value) { + return Metadata_Language_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required string title = 3; + bool has_title() const; + void clear_title(); + static const int kTitleFieldNumber = 3; + const ::std::string& title() const; + void set_title(const ::std::string& value); + #if LANG_CXX11 + void set_title(::std::string&& value); + #endif + void set_title(const char* value); + void set_title(const char* value, size_t size); + ::std::string* mutable_title(); + ::std::string* release_title(); + void set_allocated_title(::std::string* title); + + // required string description = 4; + bool has_description() const; + void clear_description(); + static const int kDescriptionFieldNumber = 4; + const ::std::string& description() const; + void set_description(const ::std::string& value); + #if LANG_CXX11 + void set_description(::std::string&& value); + #endif + void set_description(const char* value); + void set_description(const char* value, size_t size); + ::std::string* mutable_description(); + ::std::string* release_description(); + void set_allocated_description(::std::string* description); + + // required string author = 5; + bool has_author() const; + void clear_author(); + static const int kAuthorFieldNumber = 5; + const ::std::string& author() const; + void set_author(const ::std::string& value); + #if LANG_CXX11 + void set_author(::std::string&& value); + #endif + void set_author(const char* value); + void set_author(const char* value, size_t size); + ::std::string* mutable_author(); + ::std::string* release_author(); + void set_allocated_author(::std::string* author); + + // required string license = 6; + bool has_license() const; + void clear_license(); + static const int kLicenseFieldNumber = 6; + const ::std::string& license() const; + void set_license(const ::std::string& value); + #if LANG_CXX11 + void set_license(::std::string&& value); + #endif + void set_license(const char* value); + void set_license(const char* value, size_t size); + ::std::string* mutable_license(); + ::std::string* release_license(); + void set_allocated_license(::std::string* license); + + // optional string thumbnail = 9; + bool has_thumbnail() const; + void clear_thumbnail(); + static const int kThumbnailFieldNumber = 9; + const ::std::string& thumbnail() const; + void set_thumbnail(const ::std::string& value); + #if LANG_CXX11 + void set_thumbnail(::std::string&& value); + #endif + void set_thumbnail(const char* value); + void set_thumbnail(const char* value, size_t size); + ::std::string* mutable_thumbnail(); + ::std::string* release_thumbnail(); + void set_allocated_thumbnail(::std::string* thumbnail); + + // optional string preview = 10; + bool has_preview() const; + void clear_preview(); + static const int kPreviewFieldNumber = 10; + const ::std::string& preview() const; + void set_preview(const ::std::string& value); + #if LANG_CXX11 + void set_preview(::std::string&& value); + #endif + void set_preview(const char* value); + void set_preview(const char* value, size_t size); + ::std::string* mutable_preview(); + ::std::string* release_preview(); + void set_allocated_preview(::std::string* preview); + + // optional string licenseUrl = 11; + bool has_licenseurl() const; + void clear_licenseurl(); + static const int kLicenseUrlFieldNumber = 11; + const ::std::string& licenseurl() const; + void set_licenseurl(const ::std::string& value); + #if LANG_CXX11 + void set_licenseurl(::std::string&& value); + #endif + void set_licenseurl(const char* value); + void set_licenseurl(const char* value, size_t size); + ::std::string* mutable_licenseurl(); + ::std::string* release_licenseurl(); + void set_allocated_licenseurl(::std::string* licenseurl); + + // optional .pb.Fee fee = 8; + bool has_fee() const; + void clear_fee(); + static const int kFeeFieldNumber = 8; + private: + const ::pb::Fee& _internal_fee() const; + public: + const ::pb::Fee& fee() const; + ::pb::Fee* release_fee(); + ::pb::Fee* mutable_fee(); + void set_allocated_fee(::pb::Fee* fee); + + // required .pb.Metadata.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Metadata_Version version() const; + void set_version(::pb::Metadata_Version value); + + // required .pb.Metadata.Language language = 2; + bool has_language() const; + void clear_language(); + static const int kLanguageFieldNumber = 2; + ::pb::Metadata_Language language() const; + void set_language(::pb::Metadata_Language value); + + // required bool nsfw = 7; + bool has_nsfw() const; + void clear_nsfw(); + static const int kNsfwFieldNumber = 7; + bool nsfw() const; + void set_nsfw(bool value); + + // @@protoc_insertion_point(class_scope:pb.Metadata) + private: + void set_has_version(); + void clear_has_version(); + void set_has_language(); + void clear_has_language(); + void set_has_title(); + void clear_has_title(); + void set_has_description(); + void clear_has_description(); + void set_has_author(); + void clear_has_author(); + void set_has_license(); + void clear_has_license(); + void set_has_nsfw(); + void clear_has_nsfw(); + void set_has_fee(); + void clear_has_fee(); + void set_has_thumbnail(); + void clear_has_thumbnail(); + void set_has_preview(); + void clear_has_preview(); + void set_has_licenseurl(); + void clear_has_licenseurl(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr title_; + ::google::protobuf::internal::ArenaStringPtr description_; + ::google::protobuf::internal::ArenaStringPtr author_; + ::google::protobuf::internal::ArenaStringPtr license_; + ::google::protobuf::internal::ArenaStringPtr thumbnail_; + ::google::protobuf::internal::ArenaStringPtr preview_; + ::google::protobuf::internal::ArenaStringPtr licenseurl_; + ::pb::Fee* fee_; + int version_; + int language_; + bool nsfw_; + friend struct ::protobuf_metadata_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Metadata + +// required .pb.Metadata.Version version = 1; +inline bool Metadata::has_version() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void Metadata::set_has_version() { + _has_bits_[0] |= 0x00000100u; +} +inline void Metadata::clear_has_version() { + _has_bits_[0] &= ~0x00000100u; +} +inline void Metadata::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Metadata_Version Metadata::version() const { + // @@protoc_insertion_point(field_get:pb.Metadata.version) + return static_cast< ::pb::Metadata_Version >(version_); +} +inline void Metadata::set_version(::pb::Metadata_Version value) { + assert(::pb::Metadata_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Metadata.version) +} + +// required .pb.Metadata.Language language = 2; +inline bool Metadata::has_language() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void Metadata::set_has_language() { + _has_bits_[0] |= 0x00000200u; +} +inline void Metadata::clear_has_language() { + _has_bits_[0] &= ~0x00000200u; +} +inline void Metadata::clear_language() { + language_ = 0; + clear_has_language(); +} +inline ::pb::Metadata_Language Metadata::language() const { + // @@protoc_insertion_point(field_get:pb.Metadata.language) + return static_cast< ::pb::Metadata_Language >(language_); +} +inline void Metadata::set_language(::pb::Metadata_Language value) { + assert(::pb::Metadata_Language_IsValid(value)); + set_has_language(); + language_ = value; + // @@protoc_insertion_point(field_set:pb.Metadata.language) +} + +// required string title = 3; +inline bool Metadata::has_title() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Metadata::set_has_title() { + _has_bits_[0] |= 0x00000001u; +} +inline void Metadata::clear_has_title() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Metadata::clear_title() { + title_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_title(); +} +inline const ::std::string& Metadata::title() const { + // @@protoc_insertion_point(field_get:pb.Metadata.title) + return title_.GetNoArena(); +} +inline void Metadata::set_title(const ::std::string& value) { + set_has_title(); + title_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.title) +} +#if LANG_CXX11 +inline void Metadata::set_title(::std::string&& value) { + set_has_title(); + title_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.title) +} +#endif +inline void Metadata::set_title(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_title(); + title_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.title) +} +inline void Metadata::set_title(const char* value, size_t size) { + set_has_title(); + title_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.title) +} +inline ::std::string* Metadata::mutable_title() { + set_has_title(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.title) + return title_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_title() { + // @@protoc_insertion_point(field_release:pb.Metadata.title) + if (!has_title()) { + return NULL; + } + clear_has_title(); + return title_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_title(::std::string* title) { + if (title != NULL) { + set_has_title(); + } else { + clear_has_title(); + } + title_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), title); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.title) +} + +// required string description = 4; +inline bool Metadata::has_description() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Metadata::set_has_description() { + _has_bits_[0] |= 0x00000002u; +} +inline void Metadata::clear_has_description() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Metadata::clear_description() { + description_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_description(); +} +inline const ::std::string& Metadata::description() const { + // @@protoc_insertion_point(field_get:pb.Metadata.description) + return description_.GetNoArena(); +} +inline void Metadata::set_description(const ::std::string& value) { + set_has_description(); + description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.description) +} +#if LANG_CXX11 +inline void Metadata::set_description(::std::string&& value) { + set_has_description(); + description_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.description) +} +#endif +inline void Metadata::set_description(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_description(); + description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.description) +} +inline void Metadata::set_description(const char* value, size_t size) { + set_has_description(); + description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.description) +} +inline ::std::string* Metadata::mutable_description() { + set_has_description(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.description) + return description_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_description() { + // @@protoc_insertion_point(field_release:pb.Metadata.description) + if (!has_description()) { + return NULL; + } + clear_has_description(); + return description_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_description(::std::string* description) { + if (description != NULL) { + set_has_description(); + } else { + clear_has_description(); + } + description_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), description); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.description) +} + +// required string author = 5; +inline bool Metadata::has_author() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Metadata::set_has_author() { + _has_bits_[0] |= 0x00000004u; +} +inline void Metadata::clear_has_author() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Metadata::clear_author() { + author_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_author(); +} +inline const ::std::string& Metadata::author() const { + // @@protoc_insertion_point(field_get:pb.Metadata.author) + return author_.GetNoArena(); +} +inline void Metadata::set_author(const ::std::string& value) { + set_has_author(); + author_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.author) +} +#if LANG_CXX11 +inline void Metadata::set_author(::std::string&& value) { + set_has_author(); + author_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.author) +} +#endif +inline void Metadata::set_author(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_author(); + author_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.author) +} +inline void Metadata::set_author(const char* value, size_t size) { + set_has_author(); + author_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.author) +} +inline ::std::string* Metadata::mutable_author() { + set_has_author(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.author) + return author_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_author() { + // @@protoc_insertion_point(field_release:pb.Metadata.author) + if (!has_author()) { + return NULL; + } + clear_has_author(); + return author_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_author(::std::string* author) { + if (author != NULL) { + set_has_author(); + } else { + clear_has_author(); + } + author_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), author); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.author) +} + +// required string license = 6; +inline bool Metadata::has_license() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Metadata::set_has_license() { + _has_bits_[0] |= 0x00000008u; +} +inline void Metadata::clear_has_license() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Metadata::clear_license() { + license_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_license(); +} +inline const ::std::string& Metadata::license() const { + // @@protoc_insertion_point(field_get:pb.Metadata.license) + return license_.GetNoArena(); +} +inline void Metadata::set_license(const ::std::string& value) { + set_has_license(); + license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.license) +} +#if LANG_CXX11 +inline void Metadata::set_license(::std::string&& value) { + set_has_license(); + license_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.license) +} +#endif +inline void Metadata::set_license(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_license(); + license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.license) +} +inline void Metadata::set_license(const char* value, size_t size) { + set_has_license(); + license_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.license) +} +inline ::std::string* Metadata::mutable_license() { + set_has_license(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.license) + return license_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_license() { + // @@protoc_insertion_point(field_release:pb.Metadata.license) + if (!has_license()) { + return NULL; + } + clear_has_license(); + return license_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_license(::std::string* license) { + if (license != NULL) { + set_has_license(); + } else { + clear_has_license(); + } + license_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), license); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.license) +} + +// required bool nsfw = 7; +inline bool Metadata::has_nsfw() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void Metadata::set_has_nsfw() { + _has_bits_[0] |= 0x00000400u; +} +inline void Metadata::clear_has_nsfw() { + _has_bits_[0] &= ~0x00000400u; +} +inline void Metadata::clear_nsfw() { + nsfw_ = false; + clear_has_nsfw(); +} +inline bool Metadata::nsfw() const { + // @@protoc_insertion_point(field_get:pb.Metadata.nsfw) + return nsfw_; +} +inline void Metadata::set_nsfw(bool value) { + set_has_nsfw(); + nsfw_ = value; + // @@protoc_insertion_point(field_set:pb.Metadata.nsfw) +} + +// optional .pb.Fee fee = 8; +inline bool Metadata::has_fee() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void Metadata::set_has_fee() { + _has_bits_[0] |= 0x00000080u; +} +inline void Metadata::clear_has_fee() { + _has_bits_[0] &= ~0x00000080u; +} +inline const ::pb::Fee& Metadata::_internal_fee() const { + return *fee_; +} +inline const ::pb::Fee& Metadata::fee() const { + const ::pb::Fee* p = fee_; + // @@protoc_insertion_point(field_get:pb.Metadata.fee) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Fee_default_instance_); +} +inline ::pb::Fee* Metadata::release_fee() { + // @@protoc_insertion_point(field_release:pb.Metadata.fee) + clear_has_fee(); + ::pb::Fee* temp = fee_; + fee_ = NULL; + return temp; +} +inline ::pb::Fee* Metadata::mutable_fee() { + set_has_fee(); + if (fee_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Fee>(GetArenaNoVirtual()); + fee_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Metadata.fee) + return fee_; +} +inline void Metadata::set_allocated_fee(::pb::Fee* fee) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(fee_); + } + if (fee) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + fee = ::google::protobuf::internal::GetOwnedMessage( + message_arena, fee, submessage_arena); + } + set_has_fee(); + } else { + clear_has_fee(); + } + fee_ = fee; + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.fee) +} + +// optional string thumbnail = 9; +inline bool Metadata::has_thumbnail() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Metadata::set_has_thumbnail() { + _has_bits_[0] |= 0x00000010u; +} +inline void Metadata::clear_has_thumbnail() { + _has_bits_[0] &= ~0x00000010u; +} +inline void Metadata::clear_thumbnail() { + thumbnail_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_thumbnail(); +} +inline const ::std::string& Metadata::thumbnail() const { + // @@protoc_insertion_point(field_get:pb.Metadata.thumbnail) + return thumbnail_.GetNoArena(); +} +inline void Metadata::set_thumbnail(const ::std::string& value) { + set_has_thumbnail(); + thumbnail_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.thumbnail) +} +#if LANG_CXX11 +inline void Metadata::set_thumbnail(::std::string&& value) { + set_has_thumbnail(); + thumbnail_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.thumbnail) +} +#endif +inline void Metadata::set_thumbnail(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_thumbnail(); + thumbnail_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.thumbnail) +} +inline void Metadata::set_thumbnail(const char* value, size_t size) { + set_has_thumbnail(); + thumbnail_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.thumbnail) +} +inline ::std::string* Metadata::mutable_thumbnail() { + set_has_thumbnail(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.thumbnail) + return thumbnail_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_thumbnail() { + // @@protoc_insertion_point(field_release:pb.Metadata.thumbnail) + if (!has_thumbnail()) { + return NULL; + } + clear_has_thumbnail(); + return thumbnail_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_thumbnail(::std::string* thumbnail) { + if (thumbnail != NULL) { + set_has_thumbnail(); + } else { + clear_has_thumbnail(); + } + thumbnail_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), thumbnail); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.thumbnail) +} + +// optional string preview = 10; +inline bool Metadata::has_preview() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void Metadata::set_has_preview() { + _has_bits_[0] |= 0x00000020u; +} +inline void Metadata::clear_has_preview() { + _has_bits_[0] &= ~0x00000020u; +} +inline void Metadata::clear_preview() { + preview_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_preview(); +} +inline const ::std::string& Metadata::preview() const { + // @@protoc_insertion_point(field_get:pb.Metadata.preview) + return preview_.GetNoArena(); +} +inline void Metadata::set_preview(const ::std::string& value) { + set_has_preview(); + preview_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.preview) +} +#if LANG_CXX11 +inline void Metadata::set_preview(::std::string&& value) { + set_has_preview(); + preview_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.preview) +} +#endif +inline void Metadata::set_preview(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_preview(); + preview_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.preview) +} +inline void Metadata::set_preview(const char* value, size_t size) { + set_has_preview(); + preview_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.preview) +} +inline ::std::string* Metadata::mutable_preview() { + set_has_preview(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.preview) + return preview_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_preview() { + // @@protoc_insertion_point(field_release:pb.Metadata.preview) + if (!has_preview()) { + return NULL; + } + clear_has_preview(); + return preview_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_preview(::std::string* preview) { + if (preview != NULL) { + set_has_preview(); + } else { + clear_has_preview(); + } + preview_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), preview); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.preview) +} + +// optional string licenseUrl = 11; +inline bool Metadata::has_licenseurl() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void Metadata::set_has_licenseurl() { + _has_bits_[0] |= 0x00000040u; +} +inline void Metadata::clear_has_licenseurl() { + _has_bits_[0] &= ~0x00000040u; +} +inline void Metadata::clear_licenseurl() { + licenseurl_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_licenseurl(); +} +inline const ::std::string& Metadata::licenseurl() const { + // @@protoc_insertion_point(field_get:pb.Metadata.licenseUrl) + return licenseurl_.GetNoArena(); +} +inline void Metadata::set_licenseurl(const ::std::string& value) { + set_has_licenseurl(); + licenseurl_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Metadata.licenseUrl) +} +#if LANG_CXX11 +inline void Metadata::set_licenseurl(::std::string&& value) { + set_has_licenseurl(); + licenseurl_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Metadata.licenseUrl) +} +#endif +inline void Metadata::set_licenseurl(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_licenseurl(); + licenseurl_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Metadata.licenseUrl) +} +inline void Metadata::set_licenseurl(const char* value, size_t size) { + set_has_licenseurl(); + licenseurl_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Metadata.licenseUrl) +} +inline ::std::string* Metadata::mutable_licenseurl() { + set_has_licenseurl(); + // @@protoc_insertion_point(field_mutable:pb.Metadata.licenseUrl) + return licenseurl_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Metadata::release_licenseurl() { + // @@protoc_insertion_point(field_release:pb.Metadata.licenseUrl) + if (!has_licenseurl()) { + return NULL; + } + clear_has_licenseurl(); + return licenseurl_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Metadata::set_allocated_licenseurl(::std::string* licenseurl) { + if (licenseurl != NULL) { + set_has_licenseurl(); + } else { + clear_has_licenseurl(); + } + licenseurl_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), licenseurl); + // @@protoc_insertion_point(field_set_allocated:pb.Metadata.licenseUrl) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Metadata_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Metadata_Version>() { + return ::pb::Metadata_Version_descriptor(); +} +template <> struct is_proto_enum< ::pb::Metadata_Language> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Metadata_Language>() { + return ::pb::Metadata_Language_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_metadata_2eproto diff --git a/cpp/signature.pb.cc b/cpp/signature.pb.cc new file mode 100644 index 0000000..55cab08 --- /dev/null +++ b/cpp/signature.pb.cc @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: signature.proto + +#include "signature.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace pb { +class SignatureDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Signature_default_instance_; +} // namespace pb +namespace protobuf_signature_2eproto { +static void InitDefaultsSignature() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Signature_default_instance_; + new (ptr) ::pb::Signature(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Signature::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Signature = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSignature}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Signature.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, signaturetype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, signature_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, certificateid_), + 2, + 3, + 0, + 1, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, sizeof(::pb::Signature)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Signature_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "signature.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\017signature.proto\022\002pb\032\021certificate.proto" + "\"\255\001\n\tSignature\022&\n\007version\030\001 \002(\0162\025.pb.Sig" + "nature.Version\022\"\n\rsignatureType\030\002 \002(\0162\013." + "pb.KeyType\022\021\n\tsignature\030\003 \002(\014\022\025\n\rcertifi" + "cateId\030\004 \002(\014\"*\n\007Version\022\023\n\017UNKNOWN_VERSI" + "ON\020\000\022\n\n\006_0_0_1\020\001" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 216); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "signature.proto", &protobuf_RegisterTypes); + ::protobuf_certificate_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_signature_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Signature_Version_descriptor() { + protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_signature_2eproto::file_level_enum_descriptors[0]; +} +bool Signature_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Signature_Version Signature::UNKNOWN_VERSION; +const Signature_Version Signature::_0_0_1; +const Signature_Version Signature::Version_MIN; +const Signature_Version Signature::Version_MAX; +const int Signature::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Signature::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Signature::kVersionFieldNumber; +const int Signature::kSignatureTypeFieldNumber; +const int Signature::kSignatureFieldNumber; +const int Signature::kCertificateIdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Signature::Signature() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_signature_2eproto::scc_info_Signature.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Signature) +} +Signature::Signature(const Signature& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_signature()) { + signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_); + } + certificateid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_certificateid()) { + certificateid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.certificateid_); + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&signaturetype_) - + reinterpret_cast(&version_)) + sizeof(signaturetype_)); + // @@protoc_insertion_point(copy_constructor:pb.Signature) +} + +void Signature::SharedCtor() { + signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + certificateid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&version_, 0, static_cast( + reinterpret_cast(&signaturetype_) - + reinterpret_cast(&version_)) + sizeof(signaturetype_)); +} + +Signature::~Signature() { + // @@protoc_insertion_point(destructor:pb.Signature) + SharedDtor(); +} + +void Signature::SharedDtor() { + signature_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + certificateid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Signature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Signature::descriptor() { + ::protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_signature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Signature& Signature::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_signature_2eproto::scc_info_Signature.base); + return *internal_default_instance(); +} + + +void Signature::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + signature_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + certificateid_.ClearNonDefaultToEmptyNoArena(); + } + } + if (cached_has_bits & 12u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&signaturetype_) - + reinterpret_cast(&version_)) + sizeof(signaturetype_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Signature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Signature) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Signature.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Signature_Version_IsValid(value)) { + set_version(static_cast< ::pb::Signature_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.KeyType signatureType = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::KeyType_IsValid(value)) { + set_signaturetype(static_cast< ::pb::KeyType >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required bytes signature = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_signature())); + } else { + goto handle_unusual; + } + break; + } + + // required bytes certificateId = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_certificateid())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Signature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Signature) + return false; +#undef DO_ +} + +void Signature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Signature.Version version = 1; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.KeyType signatureType = 2; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->signaturetype(), output); + } + + // required bytes signature = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->signature(), output); + } + + // required bytes certificateId = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->certificateid(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Signature) +} + +::google::protobuf::uint8* Signature::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Signature) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Signature.Version version = 1; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.KeyType signatureType = 2; + if (cached_has_bits & 0x00000008u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->signaturetype(), target); + } + + // required bytes signature = 3; + if (cached_has_bits & 0x00000001u) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->signature(), target); + } + + // required bytes certificateId = 4; + if (cached_has_bits & 0x00000002u) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 4, this->certificateid(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Signature) + return target; +} + +size_t Signature::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Signature) + size_t total_size = 0; + + if (has_signature()) { + // required bytes signature = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->signature()); + } + + if (has_certificateid()) { + // required bytes certificateId = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->certificateid()); + } + + if (has_version()) { + // required .pb.Signature.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_signaturetype()) { + // required .pb.KeyType signatureType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->signaturetype()); + } + + return total_size; +} +size_t Signature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Signature) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present. + // required bytes signature = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->signature()); + + // required bytes certificateId = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->certificateid()); + + // required .pb.Signature.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.KeyType signatureType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->signaturetype()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Signature::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Signature) + GOOGLE_DCHECK_NE(&from, this); + const Signature* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Signature) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Signature) + MergeFrom(*source); + } +} + +void Signature::MergeFrom(const Signature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Signature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 15u) { + if (cached_has_bits & 0x00000001u) { + set_has_signature(); + signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_); + } + if (cached_has_bits & 0x00000002u) { + set_has_certificateid(); + certificateid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.certificateid_); + } + if (cached_has_bits & 0x00000004u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000008u) { + signaturetype_ = from.signaturetype_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Signature::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Signature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Signature::CopyFrom(const Signature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Signature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Signature::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + return true; +} + +void Signature::Swap(Signature* other) { + if (other == this) return; + InternalSwap(other); +} +void Signature::InternalSwap(Signature* other) { + using std::swap; + signature_.Swap(&other->signature_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + certificateid_.Swap(&other->certificateid_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(version_, other->version_); + swap(signaturetype_, other->signaturetype_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Signature::GetMetadata() const { + protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_signature_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Signature* Arena::CreateMaybeMessage< ::pb::Signature >(Arena* arena) { + return Arena::CreateInternal< ::pb::Signature >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/signature.pb.h b/cpp/signature.pb.h new file mode 100644 index 0000000..01d1311 --- /dev/null +++ b/cpp/signature.pb.h @@ -0,0 +1,485 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: signature.proto + +#ifndef PROTOBUF_INCLUDED_signature_2eproto +#define PROTOBUF_INCLUDED_signature_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "certificate.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_signature_2eproto + +namespace protobuf_signature_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_signature_2eproto +namespace pb { +class Signature; +class SignatureDefaultTypeInternal; +extern SignatureDefaultTypeInternal _Signature_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Signature* Arena::CreateMaybeMessage<::pb::Signature>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Signature_Version { + Signature_Version_UNKNOWN_VERSION = 0, + Signature_Version__0_0_1 = 1 +}; +bool Signature_Version_IsValid(int value); +const Signature_Version Signature_Version_Version_MIN = Signature_Version_UNKNOWN_VERSION; +const Signature_Version Signature_Version_Version_MAX = Signature_Version__0_0_1; +const int Signature_Version_Version_ARRAYSIZE = Signature_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Signature_Version_descriptor(); +inline const ::std::string& Signature_Version_Name(Signature_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Signature_Version_descriptor(), value); +} +inline bool Signature_Version_Parse( + const ::std::string& name, Signature_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Signature_Version_descriptor(), name, value); +} +// =================================================================== + +class Signature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Signature) */ { + public: + Signature(); + virtual ~Signature(); + + Signature(const Signature& from); + + inline Signature& operator=(const Signature& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Signature(Signature&& from) noexcept + : Signature() { + *this = ::std::move(from); + } + + inline Signature& operator=(Signature&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Signature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Signature* internal_default_instance() { + return reinterpret_cast( + &_Signature_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Signature* other); + friend void swap(Signature& a, Signature& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Signature* New() const final { + return CreateMaybeMessage(NULL); + } + + Signature* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Signature& from); + void MergeFrom(const Signature& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Signature* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Signature_Version Version; + static const Version UNKNOWN_VERSION = + Signature_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Signature_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Signature_Version_IsValid(value); + } + static const Version Version_MIN = + Signature_Version_Version_MIN; + static const Version Version_MAX = + Signature_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Signature_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Signature_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Signature_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Signature_Version_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required bytes signature = 3; + bool has_signature() const; + void clear_signature(); + static const int kSignatureFieldNumber = 3; + const ::std::string& signature() const; + void set_signature(const ::std::string& value); + #if LANG_CXX11 + void set_signature(::std::string&& value); + #endif + void set_signature(const char* value); + void set_signature(const void* value, size_t size); + ::std::string* mutable_signature(); + ::std::string* release_signature(); + void set_allocated_signature(::std::string* signature); + + // required bytes certificateId = 4; + bool has_certificateid() const; + void clear_certificateid(); + static const int kCertificateIdFieldNumber = 4; + const ::std::string& certificateid() const; + void set_certificateid(const ::std::string& value); + #if LANG_CXX11 + void set_certificateid(::std::string&& value); + #endif + void set_certificateid(const char* value); + void set_certificateid(const void* value, size_t size); + ::std::string* mutable_certificateid(); + ::std::string* release_certificateid(); + void set_allocated_certificateid(::std::string* certificateid); + + // required .pb.Signature.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Signature_Version version() const; + void set_version(::pb::Signature_Version value); + + // required .pb.KeyType signatureType = 2; + bool has_signaturetype() const; + void clear_signaturetype(); + static const int kSignatureTypeFieldNumber = 2; + ::pb::KeyType signaturetype() const; + void set_signaturetype(::pb::KeyType value); + + // @@protoc_insertion_point(class_scope:pb.Signature) + private: + void set_has_version(); + void clear_has_version(); + void set_has_signaturetype(); + void clear_has_signaturetype(); + void set_has_signature(); + void clear_has_signature(); + void set_has_certificateid(); + void clear_has_certificateid(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr signature_; + ::google::protobuf::internal::ArenaStringPtr certificateid_; + int version_; + int signaturetype_; + friend struct ::protobuf_signature_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Signature + +// required .pb.Signature.Version version = 1; +inline bool Signature::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Signature::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void Signature::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Signature::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Signature_Version Signature::version() const { + // @@protoc_insertion_point(field_get:pb.Signature.version) + return static_cast< ::pb::Signature_Version >(version_); +} +inline void Signature::set_version(::pb::Signature_Version value) { + assert(::pb::Signature_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Signature.version) +} + +// required .pb.KeyType signatureType = 2; +inline bool Signature::has_signaturetype() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Signature::set_has_signaturetype() { + _has_bits_[0] |= 0x00000008u; +} +inline void Signature::clear_has_signaturetype() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Signature::clear_signaturetype() { + signaturetype_ = 0; + clear_has_signaturetype(); +} +inline ::pb::KeyType Signature::signaturetype() const { + // @@protoc_insertion_point(field_get:pb.Signature.signatureType) + return static_cast< ::pb::KeyType >(signaturetype_); +} +inline void Signature::set_signaturetype(::pb::KeyType value) { + assert(::pb::KeyType_IsValid(value)); + set_has_signaturetype(); + signaturetype_ = value; + // @@protoc_insertion_point(field_set:pb.Signature.signatureType) +} + +// required bytes signature = 3; +inline bool Signature::has_signature() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Signature::set_has_signature() { + _has_bits_[0] |= 0x00000001u; +} +inline void Signature::clear_has_signature() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Signature::clear_signature() { + signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_signature(); +} +inline const ::std::string& Signature::signature() const { + // @@protoc_insertion_point(field_get:pb.Signature.signature) + return signature_.GetNoArena(); +} +inline void Signature::set_signature(const ::std::string& value) { + set_has_signature(); + signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Signature.signature) +} +#if LANG_CXX11 +inline void Signature::set_signature(::std::string&& value) { + set_has_signature(); + signature_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Signature.signature) +} +#endif +inline void Signature::set_signature(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_signature(); + signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Signature.signature) +} +inline void Signature::set_signature(const void* value, size_t size) { + set_has_signature(); + signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Signature.signature) +} +inline ::std::string* Signature::mutable_signature() { + set_has_signature(); + // @@protoc_insertion_point(field_mutable:pb.Signature.signature) + return signature_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Signature::release_signature() { + // @@protoc_insertion_point(field_release:pb.Signature.signature) + if (!has_signature()) { + return NULL; + } + clear_has_signature(); + return signature_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Signature::set_allocated_signature(::std::string* signature) { + if (signature != NULL) { + set_has_signature(); + } else { + clear_has_signature(); + } + signature_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), signature); + // @@protoc_insertion_point(field_set_allocated:pb.Signature.signature) +} + +// required bytes certificateId = 4; +inline bool Signature::has_certificateid() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Signature::set_has_certificateid() { + _has_bits_[0] |= 0x00000002u; +} +inline void Signature::clear_has_certificateid() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Signature::clear_certificateid() { + certificateid_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_certificateid(); +} +inline const ::std::string& Signature::certificateid() const { + // @@protoc_insertion_point(field_get:pb.Signature.certificateId) + return certificateid_.GetNoArena(); +} +inline void Signature::set_certificateid(const ::std::string& value) { + set_has_certificateid(); + certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Signature.certificateId) +} +#if LANG_CXX11 +inline void Signature::set_certificateid(::std::string&& value) { + set_has_certificateid(); + certificateid_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Signature.certificateId) +} +#endif +inline void Signature::set_certificateid(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_certificateid(); + certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Signature.certificateId) +} +inline void Signature::set_certificateid(const void* value, size_t size) { + set_has_certificateid(); + certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Signature.certificateId) +} +inline ::std::string* Signature::mutable_certificateid() { + set_has_certificateid(); + // @@protoc_insertion_point(field_mutable:pb.Signature.certificateId) + return certificateid_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Signature::release_certificateid() { + // @@protoc_insertion_point(field_release:pb.Signature.certificateId) + if (!has_certificateid()) { + return NULL; + } + clear_has_certificateid(); + return certificateid_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Signature::set_allocated_certificateid(::std::string* certificateid) { + if (certificateid != NULL) { + set_has_certificateid(); + } else { + clear_has_certificateid(); + } + certificateid_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), certificateid); + // @@protoc_insertion_point(field_set_allocated:pb.Signature.certificateId) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Signature_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Signature_Version>() { + return ::pb::Signature_Version_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_signature_2eproto diff --git a/cpp/source.pb.cc b/cpp/source.pb.cc new file mode 100644 index 0000000..470a5ac --- /dev/null +++ b/cpp/source.pb.cc @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: source.proto + +#include "source.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace pb { +class SourceDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Source_default_instance_; +} // namespace pb +namespace protobuf_source_2eproto { +static void InitDefaultsSource() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Source_default_instance_; + new (ptr) ::pb::Source(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Source::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_Source = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSource}, {}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Source.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, sourcetype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, source_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, contenttype_), + 2, + 3, + 0, + 1, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 9, sizeof(::pb::Source)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Source_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "source.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\014source.proto\022\002pb\"\344\001\n\006Source\022#\n\007version" + "\030\001 \002(\0162\022.pb.Source.Version\022*\n\nsourceType" + "\030\002 \002(\0162\026.pb.Source.SourceTypes\022\016\n\006source" + "\030\003 \002(\014\022\023\n\013contentType\030\004 \002(\t\"*\n\007Version\022\023" + "\n\017UNKNOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001\"8\n\013Sourc" + "eTypes\022\027\n\023UNKNOWN_SOURCE_TYPE\020\000\022\020\n\014lbry_" + "sd_hash\020\001" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 249); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "source.proto", &protobuf_RegisterTypes); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_source_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Source_Version_descriptor() { + protobuf_source_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_source_2eproto::file_level_enum_descriptors[0]; +} +bool Source_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Source_Version Source::UNKNOWN_VERSION; +const Source_Version Source::_0_0_1; +const Source_Version Source::Version_MIN; +const Source_Version Source::Version_MAX; +const int Source::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* Source_SourceTypes_descriptor() { + protobuf_source_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_source_2eproto::file_level_enum_descriptors[1]; +} +bool Source_SourceTypes_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Source_SourceTypes Source::UNKNOWN_SOURCE_TYPE; +const Source_SourceTypes Source::lbry_sd_hash; +const Source_SourceTypes Source::SourceTypes_MIN; +const Source_SourceTypes Source::SourceTypes_MAX; +const int Source::SourceTypes_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Source::InitAsDefaultInstance() { +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Source::kVersionFieldNumber; +const int Source::kSourceTypeFieldNumber; +const int Source::kSourceFieldNumber; +const int Source::kContentTypeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Source::Source() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_source_2eproto::scc_info_Source.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Source) +} +Source::Source(const Source& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_source()) { + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + contenttype_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_contenttype()) { + contenttype_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.contenttype_); + } + ::memcpy(&version_, &from.version_, + static_cast(reinterpret_cast(&sourcetype_) - + reinterpret_cast(&version_)) + sizeof(sourcetype_)); + // @@protoc_insertion_point(copy_constructor:pb.Source) +} + +void Source::SharedCtor() { + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + contenttype_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&version_, 0, static_cast( + reinterpret_cast(&sourcetype_) - + reinterpret_cast(&version_)) + sizeof(sourcetype_)); +} + +Source::~Source() { + // @@protoc_insertion_point(destructor:pb.Source) + SharedDtor(); +} + +void Source::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + contenttype_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +void Source::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Source::descriptor() { + ::protobuf_source_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_source_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Source& Source::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_source_2eproto::scc_info_Source.base); + return *internal_default_instance(); +} + + +void Source::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Source) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + source_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + contenttype_.ClearNonDefaultToEmptyNoArena(); + } + } + if (cached_has_bits & 12u) { + ::memset(&version_, 0, static_cast( + reinterpret_cast(&sourcetype_) - + reinterpret_cast(&version_)) + sizeof(sourcetype_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Source::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Source) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Source.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Source_Version_IsValid(value)) { + set_version(static_cast< ::pb::Source_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Source.SourceTypes sourceType = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Source_SourceTypes_IsValid(value)) { + set_sourcetype(static_cast< ::pb::Source_SourceTypes >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 2, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required bytes source = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_source())); + } else { + goto handle_unusual; + } + break; + } + + // required string contentType = 4; + case 4: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_contenttype())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->contenttype().data(), static_cast(this->contenttype().length()), + ::google::protobuf::internal::WireFormat::PARSE, + "pb.Source.contentType"); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Source) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Source) + return false; +#undef DO_ +} + +void Source::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Source) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Source.Version version = 1; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.Source.SourceTypes sourceType = 2; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->sourcetype(), output); + } + + // required bytes source = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->source(), output); + } + + // required string contentType = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->contenttype().data(), static_cast(this->contenttype().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Source.contentType"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->contenttype(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Source) +} + +::google::protobuf::uint8* Source::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Source) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Source.Version version = 1; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.Source.SourceTypes sourceType = 2; + if (cached_has_bits & 0x00000008u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->sourcetype(), target); + } + + // required bytes source = 3; + if (cached_has_bits & 0x00000001u) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 3, this->source(), target); + } + + // required string contentType = 4; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->contenttype().data(), static_cast(this->contenttype().length()), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "pb.Source.contentType"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->contenttype(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Source) + return target; +} + +size_t Source::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Source) + size_t total_size = 0; + + if (has_source()) { + // required bytes source = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->source()); + } + + if (has_contenttype()) { + // required string contentType = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->contenttype()); + } + + if (has_version()) { + // required .pb.Source.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + if (has_sourcetype()) { + // required .pb.Source.SourceTypes sourceType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->sourcetype()); + } + + return total_size; +} +size_t Source::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Source) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present. + // required bytes source = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->source()); + + // required string contentType = 4; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->contenttype()); + + // required .pb.Source.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + // required .pb.Source.SourceTypes sourceType = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->sourcetype()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Source::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Source) + GOOGLE_DCHECK_NE(&from, this); + const Source* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Source) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Source) + MergeFrom(*source); + } +} + +void Source::MergeFrom(const Source& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Source) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 15u) { + if (cached_has_bits & 0x00000001u) { + set_has_source(); + source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_); + } + if (cached_has_bits & 0x00000002u) { + set_has_contenttype(); + contenttype_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.contenttype_); + } + if (cached_has_bits & 0x00000004u) { + version_ = from.version_; + } + if (cached_has_bits & 0x00000008u) { + sourcetype_ = from.sourcetype_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Source::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Source) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Source::CopyFrom(const Source& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Source) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Source::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + return true; +} + +void Source::Swap(Source* other) { + if (other == this) return; + InternalSwap(other); +} +void Source::InternalSwap(Source* other) { + using std::swap; + source_.Swap(&other->source_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + contenttype_.Swap(&other->contenttype_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(version_, other->version_); + swap(sourcetype_, other->sourcetype_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Source::GetMetadata() const { + protobuf_source_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_source_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Source* Arena::CreateMaybeMessage< ::pb::Source >(Arena* arena) { + return Arena::CreateInternal< ::pb::Source >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/source.pb.h b/cpp/source.pb.h new file mode 100644 index 0000000..9d90e47 --- /dev/null +++ b/cpp/source.pb.h @@ -0,0 +1,534 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: source.proto + +#ifndef PROTOBUF_INCLUDED_source_2eproto +#define PROTOBUF_INCLUDED_source_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_source_2eproto + +namespace protobuf_source_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_source_2eproto +namespace pb { +class Source; +class SourceDefaultTypeInternal; +extern SourceDefaultTypeInternal _Source_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Source* Arena::CreateMaybeMessage<::pb::Source>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Source_Version { + Source_Version_UNKNOWN_VERSION = 0, + Source_Version__0_0_1 = 1 +}; +bool Source_Version_IsValid(int value); +const Source_Version Source_Version_Version_MIN = Source_Version_UNKNOWN_VERSION; +const Source_Version Source_Version_Version_MAX = Source_Version__0_0_1; +const int Source_Version_Version_ARRAYSIZE = Source_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Source_Version_descriptor(); +inline const ::std::string& Source_Version_Name(Source_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Source_Version_descriptor(), value); +} +inline bool Source_Version_Parse( + const ::std::string& name, Source_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Source_Version_descriptor(), name, value); +} +enum Source_SourceTypes { + Source_SourceTypes_UNKNOWN_SOURCE_TYPE = 0, + Source_SourceTypes_lbry_sd_hash = 1 +}; +bool Source_SourceTypes_IsValid(int value); +const Source_SourceTypes Source_SourceTypes_SourceTypes_MIN = Source_SourceTypes_UNKNOWN_SOURCE_TYPE; +const Source_SourceTypes Source_SourceTypes_SourceTypes_MAX = Source_SourceTypes_lbry_sd_hash; +const int Source_SourceTypes_SourceTypes_ARRAYSIZE = Source_SourceTypes_SourceTypes_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Source_SourceTypes_descriptor(); +inline const ::std::string& Source_SourceTypes_Name(Source_SourceTypes value) { + return ::google::protobuf::internal::NameOfEnum( + Source_SourceTypes_descriptor(), value); +} +inline bool Source_SourceTypes_Parse( + const ::std::string& name, Source_SourceTypes* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Source_SourceTypes_descriptor(), name, value); +} +// =================================================================== + +class Source : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Source) */ { + public: + Source(); + virtual ~Source(); + + Source(const Source& from); + + inline Source& operator=(const Source& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Source(Source&& from) noexcept + : Source() { + *this = ::std::move(from); + } + + inline Source& operator=(Source&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Source& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Source* internal_default_instance() { + return reinterpret_cast( + &_Source_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Source* other); + friend void swap(Source& a, Source& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Source* New() const final { + return CreateMaybeMessage(NULL); + } + + Source* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Source& from); + void MergeFrom(const Source& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Source* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Source_Version Version; + static const Version UNKNOWN_VERSION = + Source_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Source_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Source_Version_IsValid(value); + } + static const Version Version_MIN = + Source_Version_Version_MIN; + static const Version Version_MAX = + Source_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Source_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Source_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Source_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Source_Version_Parse(name, value); + } + + typedef Source_SourceTypes SourceTypes; + static const SourceTypes UNKNOWN_SOURCE_TYPE = + Source_SourceTypes_UNKNOWN_SOURCE_TYPE; + static const SourceTypes lbry_sd_hash = + Source_SourceTypes_lbry_sd_hash; + static inline bool SourceTypes_IsValid(int value) { + return Source_SourceTypes_IsValid(value); + } + static const SourceTypes SourceTypes_MIN = + Source_SourceTypes_SourceTypes_MIN; + static const SourceTypes SourceTypes_MAX = + Source_SourceTypes_SourceTypes_MAX; + static const int SourceTypes_ARRAYSIZE = + Source_SourceTypes_SourceTypes_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + SourceTypes_descriptor() { + return Source_SourceTypes_descriptor(); + } + static inline const ::std::string& SourceTypes_Name(SourceTypes value) { + return Source_SourceTypes_Name(value); + } + static inline bool SourceTypes_Parse(const ::std::string& name, + SourceTypes* value) { + return Source_SourceTypes_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required bytes source = 3; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 3; + const ::std::string& source() const; + void set_source(const ::std::string& value); + #if LANG_CXX11 + void set_source(::std::string&& value); + #endif + void set_source(const char* value); + void set_source(const void* value, size_t size); + ::std::string* mutable_source(); + ::std::string* release_source(); + void set_allocated_source(::std::string* source); + + // required string contentType = 4; + bool has_contenttype() const; + void clear_contenttype(); + static const int kContentTypeFieldNumber = 4; + const ::std::string& contenttype() const; + void set_contenttype(const ::std::string& value); + #if LANG_CXX11 + void set_contenttype(::std::string&& value); + #endif + void set_contenttype(const char* value); + void set_contenttype(const char* value, size_t size); + ::std::string* mutable_contenttype(); + ::std::string* release_contenttype(); + void set_allocated_contenttype(::std::string* contenttype); + + // required .pb.Source.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Source_Version version() const; + void set_version(::pb::Source_Version value); + + // required .pb.Source.SourceTypes sourceType = 2; + bool has_sourcetype() const; + void clear_sourcetype(); + static const int kSourceTypeFieldNumber = 2; + ::pb::Source_SourceTypes sourcetype() const; + void set_sourcetype(::pb::Source_SourceTypes value); + + // @@protoc_insertion_point(class_scope:pb.Source) + private: + void set_has_version(); + void clear_has_version(); + void set_has_sourcetype(); + void clear_has_sourcetype(); + void set_has_source(); + void clear_has_source(); + void set_has_contenttype(); + void clear_has_contenttype(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr contenttype_; + int version_; + int sourcetype_; + friend struct ::protobuf_source_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Source + +// required .pb.Source.Version version = 1; +inline bool Source::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Source::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void Source::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Source::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Source_Version Source::version() const { + // @@protoc_insertion_point(field_get:pb.Source.version) + return static_cast< ::pb::Source_Version >(version_); +} +inline void Source::set_version(::pb::Source_Version value) { + assert(::pb::Source_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Source.version) +} + +// required .pb.Source.SourceTypes sourceType = 2; +inline bool Source::has_sourcetype() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Source::set_has_sourcetype() { + _has_bits_[0] |= 0x00000008u; +} +inline void Source::clear_has_sourcetype() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Source::clear_sourcetype() { + sourcetype_ = 0; + clear_has_sourcetype(); +} +inline ::pb::Source_SourceTypes Source::sourcetype() const { + // @@protoc_insertion_point(field_get:pb.Source.sourceType) + return static_cast< ::pb::Source_SourceTypes >(sourcetype_); +} +inline void Source::set_sourcetype(::pb::Source_SourceTypes value) { + assert(::pb::Source_SourceTypes_IsValid(value)); + set_has_sourcetype(); + sourcetype_ = value; + // @@protoc_insertion_point(field_set:pb.Source.sourceType) +} + +// required bytes source = 3; +inline bool Source::has_source() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Source::set_has_source() { + _has_bits_[0] |= 0x00000001u; +} +inline void Source::clear_has_source() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Source::clear_source() { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source(); +} +inline const ::std::string& Source::source() const { + // @@protoc_insertion_point(field_get:pb.Source.source) + return source_.GetNoArena(); +} +inline void Source::set_source(const ::std::string& value) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Source.source) +} +#if LANG_CXX11 +inline void Source::set_source(::std::string&& value) { + set_has_source(); + source_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Source.source) +} +#endif +inline void Source::set_source(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Source.source) +} +inline void Source::set_source(const void* value, size_t size) { + set_has_source(); + source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Source.source) +} +inline ::std::string* Source::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:pb.Source.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Source::release_source() { + // @@protoc_insertion_point(field_release:pb.Source.source) + if (!has_source()) { + return NULL; + } + clear_has_source(); + return source_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Source::set_allocated_source(::std::string* source) { + if (source != NULL) { + set_has_source(); + } else { + clear_has_source(); + } + source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source); + // @@protoc_insertion_point(field_set_allocated:pb.Source.source) +} + +// required string contentType = 4; +inline bool Source::has_contenttype() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Source::set_has_contenttype() { + _has_bits_[0] |= 0x00000002u; +} +inline void Source::clear_has_contenttype() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Source::clear_contenttype() { + contenttype_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_contenttype(); +} +inline const ::std::string& Source::contenttype() const { + // @@protoc_insertion_point(field_get:pb.Source.contentType) + return contenttype_.GetNoArena(); +} +inline void Source::set_contenttype(const ::std::string& value) { + set_has_contenttype(); + contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:pb.Source.contentType) +} +#if LANG_CXX11 +inline void Source::set_contenttype(::std::string&& value) { + set_has_contenttype(); + contenttype_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:pb.Source.contentType) +} +#endif +inline void Source::set_contenttype(const char* value) { + GOOGLE_DCHECK(value != NULL); + set_has_contenttype(); + contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:pb.Source.contentType) +} +inline void Source::set_contenttype(const char* value, size_t size) { + set_has_contenttype(); + contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:pb.Source.contentType) +} +inline ::std::string* Source::mutable_contenttype() { + set_has_contenttype(); + // @@protoc_insertion_point(field_mutable:pb.Source.contentType) + return contenttype_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Source::release_contenttype() { + // @@protoc_insertion_point(field_release:pb.Source.contentType) + if (!has_contenttype()) { + return NULL; + } + clear_has_contenttype(); + return contenttype_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void Source::set_allocated_contenttype(::std::string* contenttype) { + if (contenttype != NULL) { + set_has_contenttype(); + } else { + clear_has_contenttype(); + } + contenttype_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), contenttype); + // @@protoc_insertion_point(field_set_allocated:pb.Source.contentType) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Source_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Source_Version>() { + return ::pb::Source_Version_descriptor(); +} +template <> struct is_proto_enum< ::pb::Source_SourceTypes> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Source_SourceTypes>() { + return ::pb::Source_SourceTypes_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_source_2eproto diff --git a/cpp/stream.pb.cc b/cpp/stream.pb.cc new file mode 100644 index 0000000..5c3a28e --- /dev/null +++ b/cpp/stream.pb.cc @@ -0,0 +1,540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: stream.proto + +#include "stream.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// This is a temporary google only hack +#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS +#include "third_party/protobuf/version.h" +#endif +// @@protoc_insertion_point(includes) + +namespace protobuf_metadata_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_metadata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Metadata; +} // namespace protobuf_metadata_2eproto +namespace protobuf_source_2eproto { +extern PROTOBUF_INTERNAL_EXPORT_protobuf_source_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Source; +} // namespace protobuf_source_2eproto +namespace pb { +class StreamDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; +} _Stream_default_instance_; +} // namespace pb +namespace protobuf_stream_2eproto { +static void InitDefaultsStream() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::pb::_Stream_default_instance_; + new (ptr) ::pb::Stream(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::pb::Stream::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<2> scc_info_Stream = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsStream}, { + &protobuf_metadata_2eproto::scc_info_Metadata.base, + &protobuf_source_2eproto::scc_info_Source.base,}}; + +void InitDefaults() { + ::google::protobuf::internal::InitSCC(&scc_info_Stream.base); +} + +::google::protobuf::Metadata file_level_metadata[1]; +const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; + +const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, _has_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, source_), + 2, + 0, + 1, +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + { 0, 8, sizeof(::pb::Stream)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::pb::_Stream_default_instance_), +}; + +void protobuf_AssignDescriptors() { + AddDescriptors(); + AssignDescriptors( + "stream.proto", schemas, file_default_instances, TableStruct::offsets, + file_level_metadata, file_level_enum_descriptors, NULL); +} + +void protobuf_AssignDescriptorsOnce() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); +} + +void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); +} + +void AddDescriptorsImpl() { + InitDefaults(); + static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + "\n\014stream.proto\022\002pb\032\016metadata.proto\032\014sour" + "ce.proto\"\225\001\n\006Stream\022#\n\007version\030\001 \002(\0162\022.p" + "b.Stream.Version\022\036\n\010metadata\030\002 \002(\0132\014.pb." + "Metadata\022\032\n\006source\030\003 \002(\0132\n.pb.Source\"*\n\007" + "Version\022\023\n\017UNKNOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001" + }; + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + descriptor, 200); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "stream.proto", &protobuf_RegisterTypes); + ::protobuf_metadata_2eproto::AddDescriptors(); + ::protobuf_source_2eproto::AddDescriptors(); +} + +void AddDescriptors() { + static ::google::protobuf::internal::once_flag once; + ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); +} +// Force AddDescriptors() to be called at dynamic initialization time. +struct StaticDescriptorInitializer { + StaticDescriptorInitializer() { + AddDescriptors(); + } +} static_descriptor_initializer; +} // namespace protobuf_stream_2eproto +namespace pb { +const ::google::protobuf::EnumDescriptor* Stream_Version_descriptor() { + protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce(); + return protobuf_stream_2eproto::file_level_enum_descriptors[0]; +} +bool Stream_Version_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const Stream_Version Stream::UNKNOWN_VERSION; +const Stream_Version Stream::_0_0_1; +const Stream_Version Stream::Version_MIN; +const Stream_Version Stream::Version_MAX; +const int Stream::Version_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +// =================================================================== + +void Stream::InitAsDefaultInstance() { + ::pb::_Stream_default_instance_._instance.get_mutable()->metadata_ = const_cast< ::pb::Metadata*>( + ::pb::Metadata::internal_default_instance()); + ::pb::_Stream_default_instance_._instance.get_mutable()->source_ = const_cast< ::pb::Source*>( + ::pb::Source::internal_default_instance()); +} +void Stream::clear_metadata() { + if (metadata_ != NULL) metadata_->Clear(); + clear_has_metadata(); +} +void Stream::clear_source() { + if (source_ != NULL) source_->Clear(); + clear_has_source(); +} +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Stream::kVersionFieldNumber; +const int Stream::kMetadataFieldNumber; +const int Stream::kSourceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Stream::Stream() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + ::google::protobuf::internal::InitSCC( + &protobuf_stream_2eproto::scc_info_Stream.base); + SharedCtor(); + // @@protoc_insertion_point(constructor:pb.Stream) +} +Stream::Stream(const Stream& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_metadata()) { + metadata_ = new ::pb::Metadata(*from.metadata_); + } else { + metadata_ = NULL; + } + if (from.has_source()) { + source_ = new ::pb::Source(*from.source_); + } else { + source_ = NULL; + } + version_ = from.version_; + // @@protoc_insertion_point(copy_constructor:pb.Stream) +} + +void Stream::SharedCtor() { + ::memset(&metadata_, 0, static_cast( + reinterpret_cast(&version_) - + reinterpret_cast(&metadata_)) + sizeof(version_)); +} + +Stream::~Stream() { + // @@protoc_insertion_point(destructor:pb.Stream) + SharedDtor(); +} + +void Stream::SharedDtor() { + if (this != internal_default_instance()) delete metadata_; + if (this != internal_default_instance()) delete source_; +} + +void Stream::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const ::google::protobuf::Descriptor* Stream::descriptor() { + ::protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_stream_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; +} + +const Stream& Stream::default_instance() { + ::google::protobuf::internal::InitSCC(&protobuf_stream_2eproto::scc_info_Stream.base); + return *internal_default_instance(); +} + + +void Stream::Clear() { +// @@protoc_insertion_point(message_clear_start:pb.Stream) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(metadata_ != NULL); + metadata_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(source_ != NULL); + source_->Clear(); + } + } + version_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +bool Stream::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:pb.Stream) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .pb.Stream.Version version = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::pb::Stream_Version_IsValid(value)) { + set_version(static_cast< ::pb::Stream_Version >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 1, static_cast< ::google::protobuf::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Metadata metadata = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_metadata())); + } else { + goto handle_unusual; + } + break; + } + + // required .pb.Source source = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == + static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( + input, mutable_source())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:pb.Stream) + return true; +failure: + // @@protoc_insertion_point(parse_failure:pb.Stream) + return false; +#undef DO_ +} + +void Stream::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:pb.Stream) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Stream.Version version = 1; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->version(), output); + } + + // required .pb.Metadata metadata = 2; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->_internal_metadata(), output); + } + + // required .pb.Source source = 3; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->_internal_source(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:pb.Stream) +} + +::google::protobuf::uint8* Stream::InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const { + (void)deterministic; // Unused + // @@protoc_insertion_point(serialize_to_array_start:pb.Stream) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .pb.Stream.Version version = 1; + if (cached_has_bits & 0x00000004u) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->version(), target); + } + + // required .pb.Metadata metadata = 2; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 2, this->_internal_metadata(), deterministic, target); + } + + // required .pb.Source source = 3; + if (cached_has_bits & 0x00000002u) { + target = ::google::protobuf::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, this->_internal_source(), deterministic, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:pb.Stream) + return target; +} + +size_t Stream::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Stream) + size_t total_size = 0; + + if (has_metadata()) { + // required .pb.Metadata metadata = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metadata_); + } + + if (has_source()) { + // required .pb.Source source = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *source_); + } + + if (has_version()) { + // required .pb.Stream.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + } + + return total_size; +} +size_t Stream::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:pb.Stream) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present. + // required .pb.Metadata metadata = 2; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *metadata_); + + // required .pb.Source source = 3; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize( + *source_); + + // required .pb.Stream.Version version = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->version()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Stream::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:pb.Stream) + GOOGLE_DCHECK_NE(&from, this); + const Stream* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Stream) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Stream) + MergeFrom(*source); + } +} + +void Stream::MergeFrom(const Stream& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:pb.Stream) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 7u) { + if (cached_has_bits & 0x00000001u) { + mutable_metadata()->::pb::Metadata::MergeFrom(from.metadata()); + } + if (cached_has_bits & 0x00000002u) { + mutable_source()->::pb::Source::MergeFrom(from.source()); + } + if (cached_has_bits & 0x00000004u) { + version_ = from.version_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Stream::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:pb.Stream) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Stream::CopyFrom(const Stream& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:pb.Stream) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Stream::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + if (has_metadata()) { + if (!this->metadata_->IsInitialized()) return false; + } + if (has_source()) { + if (!this->source_->IsInitialized()) return false; + } + return true; +} + +void Stream::Swap(Stream* other) { + if (other == this) return; + InternalSwap(other); +} +void Stream::InternalSwap(Stream* other) { + using std::swap; + swap(metadata_, other->metadata_); + swap(source_, other->source_); + swap(version_, other->version_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); +} + +::google::protobuf::Metadata Stream::GetMetadata() const { + protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce(); + return ::protobuf_stream_2eproto::file_level_metadata[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace pb +namespace google { +namespace protobuf { +template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Stream* Arena::CreateMaybeMessage< ::pb::Stream >(Arena* arena) { + return Arena::CreateInternal< ::pb::Stream >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/cpp/stream.pb.h b/cpp/stream.pb.h new file mode 100644 index 0000000..9027cb0 --- /dev/null +++ b/cpp/stream.pb.h @@ -0,0 +1,421 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: stream.proto + +#ifndef PROTOBUF_INCLUDED_stream_2eproto +#define PROTOBUF_INCLUDED_stream_2eproto + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3006000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include "metadata.pb.h" +#include "source.pb.h" +// @@protoc_insertion_point(includes) +#define PROTOBUF_INTERNAL_EXPORT_protobuf_stream_2eproto + +namespace protobuf_stream_2eproto { +// Internal implementation detail -- do not use these members. +struct TableStruct { + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[1]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors(); +} // namespace protobuf_stream_2eproto +namespace pb { +class Stream; +class StreamDefaultTypeInternal; +extern StreamDefaultTypeInternal _Stream_default_instance_; +} // namespace pb +namespace google { +namespace protobuf { +template<> ::pb::Stream* Arena::CreateMaybeMessage<::pb::Stream>(Arena*); +} // namespace protobuf +} // namespace google +namespace pb { + +enum Stream_Version { + Stream_Version_UNKNOWN_VERSION = 0, + Stream_Version__0_0_1 = 1 +}; +bool Stream_Version_IsValid(int value); +const Stream_Version Stream_Version_Version_MIN = Stream_Version_UNKNOWN_VERSION; +const Stream_Version Stream_Version_Version_MAX = Stream_Version__0_0_1; +const int Stream_Version_Version_ARRAYSIZE = Stream_Version_Version_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Stream_Version_descriptor(); +inline const ::std::string& Stream_Version_Name(Stream_Version value) { + return ::google::protobuf::internal::NameOfEnum( + Stream_Version_descriptor(), value); +} +inline bool Stream_Version_Parse( + const ::std::string& name, Stream_Version* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Stream_Version_descriptor(), name, value); +} +// =================================================================== + +class Stream : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Stream) */ { + public: + Stream(); + virtual ~Stream(); + + Stream(const Stream& from); + + inline Stream& operator=(const Stream& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + Stream(Stream&& from) noexcept + : Stream() { + *this = ::std::move(from); + } + + inline Stream& operator=(Stream&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Stream& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Stream* internal_default_instance() { + return reinterpret_cast( + &_Stream_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Stream* other); + friend void swap(Stream& a, Stream& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Stream* New() const final { + return CreateMaybeMessage(NULL); + } + + Stream* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const Stream& from); + void MergeFrom(const Stream& from); + void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + bool deterministic, ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Stream* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return NULL; + } + inline void* MaybeArenaPtr() const { + return NULL; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Stream_Version Version; + static const Version UNKNOWN_VERSION = + Stream_Version_UNKNOWN_VERSION; + static const Version _0_0_1 = + Stream_Version__0_0_1; + static inline bool Version_IsValid(int value) { + return Stream_Version_IsValid(value); + } + static const Version Version_MIN = + Stream_Version_Version_MIN; + static const Version Version_MAX = + Stream_Version_Version_MAX; + static const int Version_ARRAYSIZE = + Stream_Version_Version_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Version_descriptor() { + return Stream_Version_descriptor(); + } + static inline const ::std::string& Version_Name(Version value) { + return Stream_Version_Name(value); + } + static inline bool Version_Parse(const ::std::string& name, + Version* value) { + return Stream_Version_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required .pb.Metadata metadata = 2; + bool has_metadata() const; + void clear_metadata(); + static const int kMetadataFieldNumber = 2; + private: + const ::pb::Metadata& _internal_metadata() const; + public: + const ::pb::Metadata& metadata() const; + ::pb::Metadata* release_metadata(); + ::pb::Metadata* mutable_metadata(); + void set_allocated_metadata(::pb::Metadata* metadata); + + // required .pb.Source source = 3; + bool has_source() const; + void clear_source(); + static const int kSourceFieldNumber = 3; + private: + const ::pb::Source& _internal_source() const; + public: + const ::pb::Source& source() const; + ::pb::Source* release_source(); + ::pb::Source* mutable_source(); + void set_allocated_source(::pb::Source* source); + + // required .pb.Stream.Version version = 1; + bool has_version() const; + void clear_version(); + static const int kVersionFieldNumber = 1; + ::pb::Stream_Version version() const; + void set_version(::pb::Stream_Version value); + + // @@protoc_insertion_point(class_scope:pb.Stream) + private: + void set_has_version(); + void clear_has_version(); + void set_has_metadata(); + void clear_has_metadata(); + void set_has_source(); + void clear_has_source(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::pb::Metadata* metadata_; + ::pb::Source* source_; + int version_; + friend struct ::protobuf_stream_2eproto::TableStruct; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Stream + +// required .pb.Stream.Version version = 1; +inline bool Stream::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Stream::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void Stream::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Stream::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::pb::Stream_Version Stream::version() const { + // @@protoc_insertion_point(field_get:pb.Stream.version) + return static_cast< ::pb::Stream_Version >(version_); +} +inline void Stream::set_version(::pb::Stream_Version value) { + assert(::pb::Stream_Version_IsValid(value)); + set_has_version(); + version_ = value; + // @@protoc_insertion_point(field_set:pb.Stream.version) +} + +// required .pb.Metadata metadata = 2; +inline bool Stream::has_metadata() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Stream::set_has_metadata() { + _has_bits_[0] |= 0x00000001u; +} +inline void Stream::clear_has_metadata() { + _has_bits_[0] &= ~0x00000001u; +} +inline const ::pb::Metadata& Stream::_internal_metadata() const { + return *metadata_; +} +inline const ::pb::Metadata& Stream::metadata() const { + const ::pb::Metadata* p = metadata_; + // @@protoc_insertion_point(field_get:pb.Stream.metadata) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Metadata_default_instance_); +} +inline ::pb::Metadata* Stream::release_metadata() { + // @@protoc_insertion_point(field_release:pb.Stream.metadata) + clear_has_metadata(); + ::pb::Metadata* temp = metadata_; + metadata_ = NULL; + return temp; +} +inline ::pb::Metadata* Stream::mutable_metadata() { + set_has_metadata(); + if (metadata_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Metadata>(GetArenaNoVirtual()); + metadata_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Stream.metadata) + return metadata_; +} +inline void Stream::set_allocated_metadata(::pb::Metadata* metadata) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(metadata_); + } + if (metadata) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + metadata = ::google::protobuf::internal::GetOwnedMessage( + message_arena, metadata, submessage_arena); + } + set_has_metadata(); + } else { + clear_has_metadata(); + } + metadata_ = metadata; + // @@protoc_insertion_point(field_set_allocated:pb.Stream.metadata) +} + +// required .pb.Source source = 3; +inline bool Stream::has_source() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Stream::set_has_source() { + _has_bits_[0] |= 0x00000002u; +} +inline void Stream::clear_has_source() { + _has_bits_[0] &= ~0x00000002u; +} +inline const ::pb::Source& Stream::_internal_source() const { + return *source_; +} +inline const ::pb::Source& Stream::source() const { + const ::pb::Source* p = source_; + // @@protoc_insertion_point(field_get:pb.Stream.source) + return p != NULL ? *p : *reinterpret_cast( + &::pb::_Source_default_instance_); +} +inline ::pb::Source* Stream::release_source() { + // @@protoc_insertion_point(field_release:pb.Stream.source) + clear_has_source(); + ::pb::Source* temp = source_; + source_ = NULL; + return temp; +} +inline ::pb::Source* Stream::mutable_source() { + set_has_source(); + if (source_ == NULL) { + auto* p = CreateMaybeMessage<::pb::Source>(GetArenaNoVirtual()); + source_ = p; + } + // @@protoc_insertion_point(field_mutable:pb.Stream.source) + return source_; +} +inline void Stream::set_allocated_source(::pb::Source* source) { + ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == NULL) { + delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_); + } + if (source) { + ::google::protobuf::Arena* submessage_arena = NULL; + if (message_arena != submessage_arena) { + source = ::google::protobuf::internal::GetOwnedMessage( + message_arena, source, submessage_arena); + } + set_has_source(); + } else { + clear_has_source(); + } + source_ = source; + // @@protoc_insertion_point(field_set_allocated:pb.Stream.source) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace pb + +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::pb::Stream_Version> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::pb::Stream_Version>() { + return ::pb::Stream_Version_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_INCLUDED_stream_2eproto