File indexing completed on 2025-01-31 10:11:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_LITE_H__
0013 #define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_LITE_H__
0014
0015 #include <string>
0016 #include <vector>
0017
0018 #include "google/protobuf/compiler/java/generator_factory.h"
0019 #include "google/protobuf/descriptor.h"
0020
0021 namespace google {
0022 namespace protobuf {
0023 namespace compiler {
0024 namespace java {
0025 class Context;
0026 class ClassNameResolver;
0027 }
0028 }
0029 namespace io {
0030 class Printer;
0031 }
0032 }
0033 }
0034
0035 namespace google {
0036 namespace protobuf {
0037 namespace compiler {
0038 namespace java {
0039
0040 class EnumLiteGenerator : public EnumGenerator {
0041 public:
0042 EnumLiteGenerator(const EnumDescriptor* descriptor, bool immutable_api,
0043 Context* context);
0044 EnumLiteGenerator(const EnumLiteGenerator&) = delete;
0045 EnumLiteGenerator& operator=(const EnumLiteGenerator&) = delete;
0046 ~EnumLiteGenerator();
0047
0048 void Generate(io::Printer* printer) override;
0049
0050 private:
0051 const EnumDescriptor* descriptor_;
0052
0053
0054
0055
0056
0057
0058 std::vector<const EnumValueDescriptor*> canonical_values_;
0059
0060 struct Alias {
0061 const EnumValueDescriptor* value;
0062 const EnumValueDescriptor* canonical_value;
0063 };
0064 std::vector<Alias> aliases_;
0065
0066 bool immutable_api_;
0067
0068 Context* context_;
0069 ClassNameResolver* name_resolver_;
0070 };
0071
0072 }
0073 }
0074 }
0075 }
0076
0077 #endif