-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava_helper.h
More file actions
50 lines (38 loc) · 1.79 KB
/
java_helper.h
File metadata and controls
50 lines (38 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Forward declarations, copied from java_helpers.h in google source.
#ifndef PROTOBUF_FOR_PB_JAVA_HELPER_H__
#define PROTOBUF_FOR_PB_JAVA_HELPER_H__
namespace google {
namespace protobuf {
namespace compiler {
namespace java {
// Converts the field's name to camel-case, e.g. "foo_bar_baz" becomes
// "fooBarBaz" or "FooBarBaz", respectively.
string UnderscoresToCamelCase(const FieldDescriptor* field);
string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field);
// Similar, but for method names. (Typically, this merely has the effect
// of lower-casing the first letter of the name.)
string UnderscoresToCamelCase(const MethodDescriptor* method);
// Strips ".proto" or ".protodevel" from the end of a filename.
string StripProto(const string& filename);
// Gets the unqualified class name for the file. Each .proto file becomes a
// single Java class, with all its contents nested in that class.
string FileClassName(const FileDescriptor* file);
// Returns the file's Java package name.
string FileJavaPackage(const FileDescriptor* file);
// Returns output directory for the given package name.
string JavaPackageToDir(string package_name);
// Converts the given fully-qualified name in the proto namespace to its
// fully-qualified name in the Java namespace, given that it is in the given
// file.
string ToJavaName(const string& full_name, const FileDescriptor* file);
// These return the fully-qualified class name corresponding to the given
// descriptor.
string ClassName(const Descriptor* descriptor);
string ClassName(const EnumDescriptor* descriptor);
string ClassName(const ServiceDescriptor* descriptor);
string ClassName(const FileDescriptor* descriptor);
} // namespace java
} // namespace compiler
} // namespace protobuf
} // namespace google
#endif // PROTOBUF_FOR_PB_JAVA_HELPER_H__