| 107 | std::string ToString(PrimitiveType type) { return primitive_strings()[type]; } |
| 108 | |
| 109 | PrimitiveType PrimitiveTypeFromString(const std::string& s) { |
| 110 | const auto& vec = primitive_strings(); |
| 111 | return static_cast<PrimitiveType>( |
| 112 | std::distance(vec.begin(), std::find(vec.begin(), vec.end(), s))); |
| 113 | } |
| 114 | |
| 115 | int ByteSize(PrimitiveType type) { |
| 116 | std::string s = ToString(type); |
no test coverage detected