| 63 | |
| 64 | template <class PBType> |
| 65 | Status ParseFromString(const char* name, std::string_view serialized, PBType* out) { |
| 66 | if (serialized.size() > static_cast<size_t>(std::numeric_limits<int>::max())) { |
| 67 | return ProtoStringInputTooBig(name); |
| 68 | } |
| 69 | if (!out->ParseFromArray(serialized.data(), static_cast<int>(serialized.size()))) { |
| 70 | return InvalidProtoString(name); |
| 71 | } |
| 72 | return Status::OK(); |
| 73 | } |
| 74 | |
| 75 | template <class PBType, class T> |
| 76 | Status SerializeToString(const char* name, const T& in, PBType* out_pb, |
no test coverage detected