// Copyright 2020-2026 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        (unknown)
// source: google/protobuf/cpp_features.proto

package protobuf

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
	reflect "reflect"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type CppFeatures_StringType int32

const (
	CppFeatures_STRING_TYPE_UNKNOWN CppFeatures_StringType = 0
	CppFeatures_VIEW                CppFeatures_StringType = 1
	CppFeatures_CORD                CppFeatures_StringType = 2
	CppFeatures_STRING              CppFeatures_StringType = 3
)

// Enum value maps for CppFeatures_StringType.
var (
	CppFeatures_StringType_name = map[int32]string{
		0: "STRING_TYPE_UNKNOWN",
		1: "VIEW",
		2: "CORD",
		3: "STRING",
	}
	CppFeatures_StringType_value = map[string]int32{
		"STRING_TYPE_UNKNOWN": 0,
		"VIEW":                1,
		"CORD":                2,
		"STRING":              3,
	}
)

func (x CppFeatures_StringType) Enum() *CppFeatures_StringType {
	p := new(CppFeatures_StringType)
	*p = x
	return p
}

func (x CppFeatures_StringType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (CppFeatures_StringType) Descriptor() protoreflect.EnumDescriptor {
	return file_google_protobuf_cpp_features_proto_enumTypes[0].Descriptor()
}

func (CppFeatures_StringType) Type() protoreflect.EnumType {
	return &file_google_protobuf_cpp_features_proto_enumTypes[0]
}

func (x CppFeatures_StringType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

type CppFeatures struct {
	state                             protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_LegacyClosedEnum       bool                   `protobuf:"varint,1,opt,name=legacy_closed_enum,json=legacyClosedEnum"`
	xxx_hidden_StringType             CppFeatures_StringType `protobuf:"varint,2,opt,name=string_type,json=stringType,enum=pb.CppFeatures_StringType"`
	xxx_hidden_EnumNameUsesStringView bool                   `protobuf:"varint,3,opt,name=enum_name_uses_string_view,json=enumNameUsesStringView"`
	XXX_raceDetectHookData            protoimpl.RaceDetectHookData
	XXX_presence                      [1]uint32
	unknownFields                     protoimpl.UnknownFields
	sizeCache                         protoimpl.SizeCache
}

func (x *CppFeatures) Reset() {
	*x = CppFeatures{}
	mi := &file_google_protobuf_cpp_features_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *CppFeatures) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CppFeatures) ProtoMessage() {}

func (x *CppFeatures) ProtoReflect() protoreflect.Message {
	mi := &file_google_protobuf_cpp_features_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (x *CppFeatures) GetLegacyClosedEnum() bool {
	if x != nil {
		return x.xxx_hidden_LegacyClosedEnum
	}
	return false
}

func (x *CppFeatures) GetStringType() CppFeatures_StringType {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 1) {
			return x.xxx_hidden_StringType
		}
	}
	return CppFeatures_STRING_TYPE_UNKNOWN
}

func (x *CppFeatures) GetEnumNameUsesStringView() bool {
	if x != nil {
		return x.xxx_hidden_EnumNameUsesStringView
	}
	return false
}

func (x *CppFeatures) SetLegacyClosedEnum(v bool) {
	x.xxx_hidden_LegacyClosedEnum = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3)
}

func (x *CppFeatures) SetStringType(v CppFeatures_StringType) {
	x.xxx_hidden_StringType = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3)
}

func (x *CppFeatures) SetEnumNameUsesStringView(v bool) {
	x.xxx_hidden_EnumNameUsesStringView = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)
}

func (x *CppFeatures) HasLegacyClosedEnum() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}

func (x *CppFeatures) HasStringType() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}

func (x *CppFeatures) HasEnumNameUsesStringView() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 2)
}

func (x *CppFeatures) ClearLegacyClosedEnum() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
	x.xxx_hidden_LegacyClosedEnum = false
}

func (x *CppFeatures) ClearStringType() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
	x.xxx_hidden_StringType = CppFeatures_STRING_TYPE_UNKNOWN
}

func (x *CppFeatures) ClearEnumNameUsesStringView() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)
	x.xxx_hidden_EnumNameUsesStringView = false
}

type CppFeatures_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	// Whether or not to treat an enum field as closed.  This option is only
	// applicable to enum fields, and will be removed in the future.  It is
	// consistent with the legacy behavior of using proto3 enum types for proto2
	// fields.
	LegacyClosedEnum       *bool
	StringType             *CppFeatures_StringType
	EnumNameUsesStringView *bool
}

func (b0 CppFeatures_builder) Build() *CppFeatures {
	m0 := &CppFeatures{}
	b, x := &b0, m0
	_, _ = b, x
	if b.LegacyClosedEnum != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3)
		x.xxx_hidden_LegacyClosedEnum = *b.LegacyClosedEnum
	}
	if b.StringType != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3)
		x.xxx_hidden_StringType = *b.StringType
	}
	if b.EnumNameUsesStringView != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)
		x.xxx_hidden_EnumNameUsesStringView = *b.EnumNameUsesStringView
	}
	return m0
}

var file_google_protobuf_cpp_features_proto_extTypes = []protoimpl.ExtensionInfo{
	{
		ExtendedType:  (*descriptorpb.FeatureSet)(nil),
		ExtensionType: (*CppFeatures)(nil),
		Field:         1000,
		Name:          "pb.cpp",
		Tag:           "bytes,1000,opt,name=cpp",
		Filename:      "google/protobuf/cpp_features.proto",
	},
}

// Extension fields to descriptorpb.FeatureSet.
var (
	// optional pb.CppFeatures cpp = 1000;
	E_Cpp = &file_google_protobuf_cpp_features_proto_extTypes[0]
)

var File_google_protobuf_cpp_features_proto protoreflect.FileDescriptor

const file_google_protobuf_cpp_features_proto_rawDesc = "" +
	"\n" +
	"\"google/protobuf/cpp_features.proto\x12\x02pb\x1a google/protobuf/descriptor.proto\"\xb2\x04\n" +
	"\vCppFeatures\x12\x8d\x02\n" +
	"\x12legacy_closed_enum\x18\x01 \x01(\bB\xde\x01\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\t\x12\x04true\x18\x84\a\xa2\x01\n" +
	"\x12\x05false\x18\xe7\a\xb2\x01\xb8\x01\b\xe8\a\x10\xe8\a\x1a\xaf\x01The legacy closed enum behavior in C++ is deprecated and is scheduled to be removed in edition 2025.  See http://protobuf.dev/programming-guides/enum/#cpp for more informationR\x10legacyClosedEnum\x12f\n" +
	"\vstring_type\x18\x02 \x01(\x0e2\x1a.pb.CppFeatures.StringTypeB)\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\v\x12\x06STRING\x18\x84\a\xa2\x01\t\x12\x04VIEW\x18\xe9\a\xb2\x01\x03\b\xe8\aR\n" +
	"stringType\x12d\n" +
	"\x1aenum_name_uses_string_view\x18\x03 \x01(\bB(\x88\x01\x02\x98\x01\x06\x98\x01\x01\xa2\x01\n" +
	"\x12\x05false\x18\x84\a\xa2\x01\t\x12\x04true\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x16enumNameUsesStringView\"E\n" +
	"\n" +
	"StringType\x12\x17\n" +
	"\x13STRING_TYPE_UNKNOWN\x10\x00\x12\b\n" +
	"\x04VIEW\x10\x01\x12\b\n" +
	"\x04CORD\x10\x02\x12\n" +
	"\n" +
	"\x06STRING\x10\x03:?\n" +
	"\x03cpp\x12\x1b.google.protobuf.FeatureSet\x18\xe8\a \x01(\v2\x0f.pb.CppFeaturesR\x03cpp"

var file_google_protobuf_cpp_features_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_protobuf_cpp_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_cpp_features_proto_goTypes = []any{
	(CppFeatures_StringType)(0),     // 0: pb.CppFeatures.StringType
	(*CppFeatures)(nil),             // 1: pb.CppFeatures
	(*descriptorpb.FeatureSet)(nil), // 2: google.protobuf.FeatureSet
}
var file_google_protobuf_cpp_features_proto_depIdxs = []int32{
	0, // 0: pb.CppFeatures.string_type:type_name -> pb.CppFeatures.StringType
	2, // 1: pb.cpp:extendee -> google.protobuf.FeatureSet
	1, // 2: pb.cpp:type_name -> pb.CppFeatures
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	2, // [2:3] is the sub-list for extension type_name
	1, // [1:2] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_google_protobuf_cpp_features_proto_init() }
func file_google_protobuf_cpp_features_proto_init() {
	if File_google_protobuf_cpp_features_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_cpp_features_proto_rawDesc), len(file_google_protobuf_cpp_features_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 1,
			NumServices:   0,
		},
		GoTypes:           file_google_protobuf_cpp_features_proto_goTypes,
		DependencyIndexes: file_google_protobuf_cpp_features_proto_depIdxs,
		EnumInfos:         file_google_protobuf_cpp_features_proto_enumTypes,
		MessageInfos:      file_google_protobuf_cpp_features_proto_msgTypes,
		ExtensionInfos:    file_google_protobuf_cpp_features_proto_extTypes,
	}.Build()
	File_google_protobuf_cpp_features_proto = out.File
	file_google_protobuf_cpp_features_proto_goTypes = nil
	file_google_protobuf_cpp_features_proto_depIdxs = nil
}
