reader.cpp 582 B

123456789101112131415161718192021222324252627
  1. #include "reader.h"
  2. #include <library/cpp/yson_pull/detail/reader.h>
  3. using namespace NYsonPull;
  4. TReader::TReader(
  5. THolder<NInput::IStream> stream,
  6. EStreamType mode)
  7. : Stream_{std::move(stream)}
  8. , Impl_{MakeHolder<NDetail::reader_impl>(*Stream_, mode)} {
  9. }
  10. TReader::TReader(TReader&& other) noexcept
  11. : Stream_{std::move(other.Stream_)}
  12. , Impl_{std::move(other.Impl_)} {
  13. }
  14. TReader::~TReader() {
  15. }
  16. const TEvent& TReader::NextEvent() {
  17. return Impl_->next_event();
  18. }
  19. const TEvent& TReader::LastEvent() const noexcept {
  20. return Impl_->last_event();
  21. }