Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef GOOGLE_PROTOBUF_COMPILER_PHP_NAMES_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_PHP_NAMES_H__
0010 
0011 #include "google/protobuf/descriptor.h"
0012 
0013 #include <string>
0014 
0015 #include "absl/strings/string_view.h"
0016 #include "google/protobuf/port_def.inc"
0017 
0018 namespace google {
0019 namespace protobuf {
0020 namespace compiler {
0021 namespace php {
0022 
0023 // Whether or not a name is reserved.
0024 PROTOC_EXPORT bool IsReservedName(absl::string_view name);
0025 
0026 // A prefix to stick in front of reserved names to avoid clashes.
0027 PROTOC_EXPORT std::string ReservedNamePrefix(absl::string_view classname,
0028                                              const FileDescriptor* file);
0029 
0030 // A prefix to stick in front of all class names.
0031 PROTOC_EXPORT std::string ClassNamePrefix(absl::string_view classname,
0032                                           const Descriptor* desc);
0033 PROTOC_EXPORT std::string ClassNamePrefix(absl::string_view classname,
0034                                           const EnumDescriptor* desc);
0035 
0036 // To skip reserved keywords in php, some generated classname are prefixed.
0037 // Other code generators may need following API to figure out the actual
0038 // classname.
0039 PROTOC_EXPORT std::string GeneratedClassName(const Descriptor* desc);
0040 PROTOC_EXPORT std::string GeneratedClassName(const EnumDescriptor* desc);
0041 PROTOC_EXPORT std::string GeneratedClassName(const ServiceDescriptor* desc);
0042 
0043 }  // namespace php
0044 }  // namespace compiler
0045 }  // namespace protobuf
0046 }  // namespace google
0047 
0048 #include "google/protobuf/port_undef.inc"
0049 
0050 #endif  // GOOGLE_PROTOBUF_COMPILER_PHP_NAMES_H__