File indexing completed on 2025-01-31 10:12:00
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_PYTHON_HELPERS_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_PYTHON_HELPERS_H__
0010
0011 #include <string>
0012
0013 #include "absl/strings/str_replace.h"
0014 #include "absl/strings/string_view.h"
0015 #include "google/protobuf/descriptor.h"
0016 #include "google/protobuf/descriptor.pb.h"
0017
0018 namespace google {
0019 namespace protobuf {
0020 namespace compiler {
0021 namespace python {
0022
0023 std::string ModuleName(absl::string_view filename);
0024 std::string StrippedModuleName(absl::string_view filename);
0025 bool ContainsPythonKeyword(absl::string_view module_name);
0026 bool IsPythonKeyword(absl::string_view name);
0027 std::string ResolveKeyword(absl::string_view name);
0028 std::string GetFileName(const FileDescriptor* file_des,
0029 absl::string_view suffix);
0030 bool HasGenericServices(const FileDescriptor* file);
0031 std::string GeneratedCodeToBase64(const GeneratedCodeInfo& annotations);
0032
0033 template <typename DescriptorT>
0034 std::string NamePrefixedWithNestedTypes(const DescriptorT& descriptor,
0035 absl::string_view separator);
0036
0037 }
0038 }
0039 }
0040 }
0041
0042 #endif