12 using Value =
typename Map::mapped_type;
14 explicit MapParser(ValueParser& value_parser)
15 : value_parser_(value_parser)
18 void Reset()
override {
this->state_ = State::kStart; }
20 void StartObject()
override {
23 this->state_ = State::kInside;
31 void Key(std::string_view key)
override {
32 if (state_ != State::kInside) {
33 this->Throw(
"object");
37 this->value_parser_.Reset();
38 this->value_parser_.Subscribe(*
this);
39 this->parser_state_->PushParser(
this->value_parser_.GetParser());
42 void EndObject()
override {
43 if (state_ == State::kInside) {
44 this->SetResult(std::move(result_));
51 std::string Expected()
const override {
64 void OnSend(Value&& value)
override {
this->result_.emplace(std::move(key_), std::move(value)); }
66 std::string GetPathItem()
const override {
return key_; }
75 ValueParser& value_parser_;