| 404 | } |
| 405 | |
| 406 | void Split(const std::string& s, char separator, std::vector<std::string>* result) { |
| 407 | const char* p = s.data(); |
| 408 | const char* end = p + s.size(); |
| 409 | while (p != end) { |
| 410 | if (*p == separator) { |
| 411 | ++p; |
| 412 | } else { |
| 413 | const char* start = p; |
| 414 | while (++p != end && *p != separator) { |
| 415 | // Skip to the next occurrence of the separator. |
| 416 | } |
| 417 | result->push_back(std::string(start, p - start)); |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | std::string PrettyDescriptor(Primitive::Type type) { |
| 423 | return PrettyDescriptor(Primitive::Descriptor(type)); |