aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/reader.cpp
blob: ea26852756c5585c58db9d831afef6b87619f5c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "reader.h"
#include <library/cpp/yson_pull/detail/reader.h>

using namespace NYsonPull;

TReader::TReader(
    THolder<NInput::IStream> stream,
    EStreamType mode)
    : Stream_{std::move(stream)}
    , Impl_{MakeHolder<NDetail::reader_impl>(*Stream_, mode)} {
}

TReader::TReader(TReader&& other) noexcept
    : Stream_{std::move(other.Stream_)}
    , Impl_{std::move(other.Impl_)} {
}

TReader::~TReader() {
}

const TEvent& TReader::NextEvent() {
    return Impl_->next_event();
}

const TEvent& TReader::LastEvent() const noexcept {
    return Impl_->last_event();
}