17 #ifndef CARTOGRAPHER_IO_PROTO_STREAM_H_ 18 #define CARTOGRAPHER_IO_PROTO_STREAM_H_ 42 template <
typename MessageType>
44 string uncompressed_data;
45 proto.SerializeToString(&uncompressed_data);
46 Write(uncompressed_data);
53 void Write(
const string& uncompressed_data);
67 template <
typename MessageType>
69 string decompressed_data;
70 return Read(&decompressed_data) &&
71 proto->ParseFromString(decompressed_data);
75 bool Read(
string* decompressed_data);
83 #endif // CARTOGRAPHER_IO_PROTO_STREAM_H_
void WriteProto(const MessageType &proto)
ProtoStreamWriter(const string &filename)
ProtoStreamWriter & operator=(const ProtoStreamWriter &)=delete
bool ReadProto(MessageType *proto)
void Write(const string &uncompressed_data)