Merge pull request #2762 from jcanizales/do-camelcase-right

Make FileNameInUpperCamel aware of directories
pull/2766/head
Michael Lumish 10 years ago
commit 222348380e
  1. 8
      src/compiler/generator_helpers.h

@ -126,7 +126,13 @@ inline grpc::string LowerUnderscoreToUpperCamel(grpc::string str) {
}
inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) {
return LowerUnderscoreToUpperCamel(StripProto(file->name()));
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] + "/";
}
result += LowerUnderscoreToUpperCamel(tokens.back());
return result;
}
enum MethodType {

Loading…
Cancel
Save