Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:12:47

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 // Generates Ruby code for a given .proto file.
0009 
0010 #ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_RUBY_GENERATOR_H__
0011 #define GOOGLE_PROTOBUF_COMPILER_RUBY_RUBY_GENERATOR_H__
0012 
0013 #include <cstdint>
0014 #include <string>
0015 
0016 #include "google/protobuf/compiler/code_generator.h"
0017 #include "google/protobuf/port_def.inc"
0018 
0019 namespace google {
0020 namespace protobuf {
0021 namespace compiler {
0022 namespace ruby {
0023 
0024 // CodeGenerator implementation for generated Ruby protocol buffer classes.
0025 // If you create your own protocol compiler binary and you want it to support
0026 // Ruby output, you can do so by registering an instance of this
0027 // CodeGenerator with the CommandLineInterface in your main() function.
0028 class PROTOC_EXPORT Generator : public CodeGenerator {
0029   bool Generate(const FileDescriptor* file, const std::string& parameter,
0030                 GeneratorContext* generator_context,
0031                 std::string* error) const override;
0032   uint64_t GetSupportedFeatures() const override {
0033     return Feature::FEATURE_PROTO3_OPTIONAL |
0034            Feature::FEATURE_SUPPORTS_EDITIONS;
0035   }
0036   Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
0037   Edition GetMaximumEdition() const override {
0038     return Edition::EDITION_2024;
0039   }
0040 };
0041 
0042 }  // namespace ruby
0043 }  // namespace compiler
0044 }  // namespace protobuf
0045 }  // namespace google
0046 
0047 #include "google/protobuf/port_undef.inc"
0048 
0049 #endif  // GOOGLE_PROTOBUF_COMPILER_RUBY_RUBY_GENERATOR_H__