File indexing completed on 2025-01-31 10:11:59
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__
0010
0011 #include <string>
0012 #include <vector>
0013
0014 #include "absl/container/flat_hash_set.h"
0015 #include "google/protobuf/compiler/objectivec/options.h"
0016 #include "google/protobuf/descriptor.h"
0017 #include "google/protobuf/io/printer.h"
0018
0019 namespace google {
0020 namespace protobuf {
0021 namespace compiler {
0022 namespace objectivec {
0023
0024 class EnumGenerator {
0025 public:
0026 EnumGenerator(const EnumDescriptor* descriptor,
0027 const GenerationOptions& generation_options);
0028 ~EnumGenerator() = default;
0029
0030 EnumGenerator(const EnumGenerator&) = delete;
0031 EnumGenerator& operator=(const EnumGenerator&) = delete;
0032
0033 void GenerateHeader(io::Printer* printer) const;
0034 void GenerateSource(io::Printer* printer) const;
0035
0036 const std::string& name() const { return name_; }
0037
0038 private:
0039 const EnumDescriptor* descriptor_;
0040 const GenerationOptions& generation_options_;
0041 std::vector<const EnumValueDescriptor*> base_values_;
0042 std::vector<const EnumValueDescriptor*> all_values_;
0043 absl::flat_hash_set<const EnumValueDescriptor*> alias_values_to_skip_;
0044 const std::string name_;
0045 };
0046
0047 }
0048 }
0049 }
0050 }
0051
0052 #endif