Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-01 10:26:07

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 ObjectiveC code for a given .proto file.
0009 
0010 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__
0011 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__
0012 
0013 #include <cstdint>
0014 #include <string>
0015 #include <vector>
0016 
0017 #include "google/protobuf/compiler/code_generator.h"
0018 #include "google/protobuf/descriptor.h"
0019 #include "google/protobuf/descriptor.pb.h"
0020 
0021 // Must be included last
0022 #include "google/protobuf/port_def.inc"
0023 
0024 namespace google {
0025 namespace protobuf {
0026 namespace compiler {
0027 namespace objectivec {
0028 
0029 // CodeGenerator implementation which generates a ObjectiveC source file and
0030 // header.  If you create your own protocol compiler binary and you want it to
0031 // support ObjectiveC output, you can do so by registering an instance of this
0032 // CodeGenerator with the CommandLineInterface in your main() function.
0033 class PROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator {
0034  public:
0035   ObjectiveCGenerator() = default;
0036   ~ObjectiveCGenerator() override = default;
0037 
0038   ObjectiveCGenerator(const ObjectiveCGenerator&) = delete;
0039   ObjectiveCGenerator& operator=(const ObjectiveCGenerator&) = delete;
0040 
0041   // implements CodeGenerator ----------------------------------------
0042   bool HasGenerateAll() const override;
0043   bool Generate(const FileDescriptor* file, const std::string& parameter,
0044                 GeneratorContext* context, std::string* error) const override;
0045   bool GenerateAll(const std::vector<const FileDescriptor*>& files,
0046                    const std::string& parameter, GeneratorContext* context,
0047                    std::string* error) const override;
0048 
0049   uint64_t GetSupportedFeatures() const override {
0050     return (FEATURE_PROTO3_OPTIONAL | FEATURE_SUPPORTS_EDITIONS);
0051   }
0052   Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
0053   Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }
0054 };
0055 
0056 }  // namespace objectivec
0057 }  // namespace compiler
0058 }  // namespace protobuf
0059 }  // namespace google
0060 
0061 #include "google/protobuf/port_undef.inc"
0062 
0063 #endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__