File indexing completed on 2025-01-31 10:11:59
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__
0010
0011 #include <string>
0012
0013 #include "absl/container/btree_set.h"
0014 #include "absl/container/flat_hash_set.h"
0015 #include "absl/strings/string_view.h"
0016 #include "google/protobuf/compiler/objectivec/options.h"
0017 #include "google/protobuf/descriptor.h"
0018 #include "google/protobuf/io/printer.h"
0019
0020 namespace google {
0021 namespace protobuf {
0022 namespace compiler {
0023 namespace objectivec {
0024
0025 class ExtensionGenerator {
0026 public:
0027 ExtensionGenerator(absl::string_view root_or_message_class_name,
0028 const FieldDescriptor* descriptor,
0029 const GenerationOptions& generation_options);
0030 ~ExtensionGenerator() = default;
0031
0032 ExtensionGenerator(const ExtensionGenerator&) = delete;
0033 ExtensionGenerator& operator=(const ExtensionGenerator&) = delete;
0034
0035 void GenerateMembersHeader(io::Printer* printer) const;
0036 void GenerateStaticVariablesInitialization(io::Printer* printer) const;
0037 void DetermineObjectiveCClassDefinitions(
0038 absl::btree_set<std::string>* fwd_decls) const;
0039 void DetermineNeededFiles(
0040 absl::flat_hash_set<const FileDescriptor*>* deps) const;
0041
0042 private:
0043 std::string method_name_;
0044 std::string full_method_name_;
0045 const FieldDescriptor* descriptor_;
0046 const GenerationOptions& generation_options_;
0047 };
0048
0049 }
0050 }
0051 }
0052 }
0053
0054 #endif