• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_
9 #define THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_
10 
11 #include <string>
12 
13 #include "absl/strings/string_view.h"
14 
15 // Must be last.
16 #include "upb/port/def.inc"
17 
18 namespace upb {
19 namespace generator {
20 
21 // Maps: foo/bar/baz.proto -> foo/bar/baz.upb_minitable.h
22 UPBC_API std::string MiniTableHeaderFilename(absl::string_view proto_filename);
23 
24 // These are the publicly visible symbols defined in foo.upb_minitable.h.
25 //   extern const upb_MiniTable <Message>;             // One for each message.
26 //   extern const upb_MiniTableEnum <Enum>;            // One for each enum.
27 //   extern const upb_MiniTableExtension <Extension>;  // One for each ext.
28 //   extern const upb_MiniTableFile <File>;            // One for each file.
29 //
30 //   extern const upb_MiniTable* <MessagePtr>;
31 
32 UPBC_API std::string MiniTableMessageVarName(absl::string_view full_name);
33 UPBC_API std::string MiniTableEnumVarName(absl::string_view full_name);
34 UPBC_API std::string MiniTableExtensionVarName(absl::string_view full_name);
35 UPBC_API std::string MiniTableFileVarName(absl::string_view proto_filename);
36 
37 // This is used for weak linking and tree shaking. Other translation units may
38 // define weak versions of this symbol that point to a dummy message, to
39 // gracefully degrade the behavior of the generated code when the message is not
40 // linked into the current binary.
41 UPBC_API std::string MiniTableMessagePtrVarName(absl::string_view full_name);
42 
43 }  // namespace generator
44 }  // namespace upb
45 
46 #endif  // THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_
47