• 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 #include "upb_generator/c/names_internal.h"
9 
10 #include <string>
11 
12 #include "absl/strings/string_view.h"
13 #include "upb_generator/common/names.h"
14 
15 namespace upb {
16 namespace generator {
17 
CApiHeaderFilename(absl::string_view proto_filename,bool bootstrap)18 std::string CApiHeaderFilename(absl::string_view proto_filename,
19                                bool bootstrap) {
20   if (bootstrap) {
21     if (IsDescriptorProto(proto_filename)) {
22       return "upb/reflection/descriptor_bootstrap.h";
23     } else {
24       return "upb_generator/plugin_bootstrap.h";
25     }
26   }
27   return StripExtension(proto_filename) + ".upb.h";
28 }
29 
30 }  // namespace generator
31 }  // namespace upb
32