| 37 | } |
| 38 | |
| 39 | const std::string FileTrailer::EncodeToString() const { |
| 40 | std::string result(kTrailerBlockMagic); |
| 41 | PutFixed64(&result, file_info_offset_); |
| 42 | PutFixed64(&result, data_index_offset_); |
| 43 | PutFixed32(&result, data_index_count_); |
| 44 | PutFixed64(&result, meta_index_offset_); |
| 45 | PutFixed32(&result, meta_index_count_); |
| 46 | PutFixed64(&result, total_uncompressed_bytes_); |
| 47 | PutFixed32(&result, entry_count_); |
| 48 | PutFixed32(&result, compress_type_); |
| 49 | PutFixed32(&result, version_); |
| 50 | return result; |
| 51 | } |
| 52 | |
| 53 | bool FileTrailer::DecodeFromString(const std::string &str) { |
| 54 | if (str.size() != static_cast<std::string::size_type>(TrailerSize())) { |
nothing calls this directly
no test coverage detected