Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:11:59

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
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 }  // namespace objectivec
0048 }  // namespace compiler
0049 }  // namespace protobuf
0050 }  // namespace google
0051 
0052 #endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__