Alright. We'll do our own thing then

pull/20141/head
Richard Belleville 6 years ago
parent d649880044
commit 358676db44
  1. 9
      src/compiler/generator_helpers.h
  2. 2
      src/compiler/python_generator.cc
  3. 10
      src/compiler/python_generator_helpers.h

@ -168,11 +168,10 @@ inline MethodType GetMethodType(
inline void Split(const grpc::string& s, char delim,
std::vector<grpc::string>* append_to) {
auto current = s.begin();
while (current <= s.end()) {
auto next = std::find(current, s.end(), delim);
append_to->emplace_back(current, next);
current = next + 1;
std::istringstream iss(s);
grpc::string piece;
while (std::getline(iss, piece)) {
append_to->push_back(piece);
}
}

@ -761,7 +761,7 @@ static bool ParseParameters(const grpc::string& parameter,
std::vector<grpc::string>* strip_prefixes,
grpc::string* error) {
std::vector<grpc::string> comma_delimited_parameters;
grpc_generator::Split(parameter, ',', &comma_delimited_parameters);
grpc_python_generator::Split(parameter, ',', &comma_delimited_parameters);
if (comma_delimited_parameters.empty()) {
*grpc_version = "grpc_2_0";
} else if (comma_delimited_parameters.size() == 1) {

@ -136,6 +136,16 @@ StringVector get_all_comments(const DescriptorType* descriptor) {
return comments;
}
inline void Split(const grpc::string& s, char delim,
std::vector<grpc::string>* append_to) {
auto current = s.begin();
while (current <= s.end()) {
auto next = std::find(current, s.end(), delim);
append_to->emplace_back(current, next);
current = next + 1;
}
}
} // namespace
} // namespace grpc_python_generator

Loading…
Cancel
Save