diff options
author | Julien Boeuf <jboeuf@google.com> | 2015-08-26 11:19:10 -0700 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2015-08-26 11:19:10 -0700 |
commit | 5b3516e2c5c3c6878d28cd19db73d5572851e6b9 (patch) | |
tree | a34bde8ab374f35f5a6a6a4cdbdf741076dbd3fa /src/compiler/generator_helpers.h | |
parent | 9a8d0d3eaf8ccd1c3a6e27f1f8bbeeee85e64345 (diff) | |
parent | 1f1919c8cfc61cd9af288cd1585b38b9c3511e1f (diff) |
Merge branch 'master' of github.com:grpc/grpc into cpp_auth_md_processor
Diffstat (limited to 'src/compiler/generator_helpers.h')
-rw-r--r-- | src/compiler/generator_helpers.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 68b807b057..e1bb66a875 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -125,16 +125,23 @@ inline grpc::string LowerUnderscoreToUpperCamel(grpc::string str) { return result; } -inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) { +inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file, + bool include_package_path) { std::vector<grpc::string> tokens = tokenize(StripProto(file->name()), "/"); grpc::string result = ""; - for (unsigned int i = 0; i < tokens.size() - 1; i++) { - result += tokens[i] + "/"; + if (include_package_path) { + for (unsigned int i = 0; i < tokens.size() - 1; i++) { + result += tokens[i] + "/"; + } } result += LowerUnderscoreToUpperCamel(tokens.back()); return result; } +inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) { + return FileNameInUpperCamel(file, true); +} + enum MethodType { METHODTYPE_NO_STREAMING, METHODTYPE_CLIENT_STREAMING, |