| 640 | } |
| 641 | |
| 642 | std::string ReaderImpl::getSerializedFileTail() const { |
| 643 | proto::FileTail tail; |
| 644 | proto::PostScript* mutable_ps = tail.mutable_postscript(); |
| 645 | mutable_ps->CopyFrom(*contents_->postscript); |
| 646 | proto::Footer* mutableFooter = tail.mutable_footer(); |
| 647 | mutableFooter->CopyFrom(*footer_); |
| 648 | tail.set_file_length(fileLength_); |
| 649 | tail.set_postscript_length(postscriptLength_); |
| 650 | std::string result; |
| 651 | if (!tail.SerializeToString(&result)) { |
| 652 | throw ParseError("Failed to serialize file tail"); |
| 653 | } |
| 654 | return result; |
| 655 | } |
| 656 | |
| 657 | const ReaderOptions& ReaderImpl::getReaderOptions() const { |
| 658 | return options_; |