Skip to content

Commit

Permalink
json_parser update -> set_buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 13, 2024
1 parent 5e0c188 commit b7051c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions include/jsoncons/json_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class basic_json_cursor : public basic_staj_cursor<CharT>, private virtual ser_c
if (ec) return;
if (s.size() > 0)
{
parser_.update(s.data(),s.size());
parser_.set_buffer(s.data(),s.size());
}
}
if (!parser_.source_exhausted())
Expand Down Expand Up @@ -354,7 +354,7 @@ class basic_json_cursor : public basic_staj_cursor<CharT>, private virtual ser_c
JSONCONS_THROW(ser_error(json_errc::illegal_unicode_character,parser_.line(),parser_.column()));
}
std::size_t offset = (r.ptr - sv.data());
parser_.update(sv.data()+offset,sv.size()-offset);
parser_.set_buffer(sv.data()+offset,sv.size()-offset);

bool is_done = parser_.done() || done_;
if (!is_done)
Expand All @@ -372,7 +372,7 @@ class basic_json_cursor : public basic_staj_cursor<CharT>, private virtual ser_c
return;
}
std::size_t offset = (r.ptr - sv.data());
parser_.update(sv.data()+offset,sv.size()-offset);
parser_.set_buffer(sv.data()+offset,sv.size()-offset);
bool is_done = parser_.done() || done_;
if (!is_done)
{
Expand Down Expand Up @@ -406,7 +406,7 @@ class basic_json_cursor : public basic_staj_cursor<CharT>, private virtual ser_c
if (ec) return;
if (s.size() > 0)
{
parser_.update(s.data(),s.size());
parser_.set_buffer(s.data(),s.size());
if (ec) return;
}
}
Expand Down
6 changes: 3 additions & 3 deletions include/jsoncons_ext/csv/csv_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class basic_csv_cursor : public basic_staj_cursor<CharT>, private virtual ser_co
JSONCONS_THROW(ser_error(json_errc::illegal_unicode_character,parser_.line(),parser_.column()));
}
std::size_t offset = (r.ptr - sv.data());
parser_.update(sv.data()+offset,sv.size()-offset);
parser_.set_buffer(sv.data()+offset,sv.size()-offset);
if (!done())
{
next();
Expand All @@ -297,7 +297,7 @@ class basic_csv_cursor : public basic_staj_cursor<CharT>, private virtual ser_co
return;
}
std::size_t offset = (r.ptr - sv.data());
parser_.update(sv.data()+offset,sv.size()-offset);
parser_.set_buffer(sv.data()+offset,sv.size()-offset);
if (!done())
{
next(ec);
Expand All @@ -320,7 +320,7 @@ class basic_csv_cursor : public basic_staj_cursor<CharT>, private virtual ser_co
if (ec) return;
if (s.size() > 0)
{
parser_.update(s.data(),s.size());
parser_.set_buffer(s.data(),s.size());
}
}
parser_.parse_some(visitor, ec);
Expand Down
6 changes: 3 additions & 3 deletions include/jsoncons_ext/csv/csv_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace jsoncons { namespace csv {
if (ec) return;
if (s.size() > 0)
{
parser_.update(s.data(),s.size());
parser_.set_buffer(s.data(),s.size());
}
}
parser_.parse_some(visitor_, ec);
Expand Down Expand Up @@ -272,7 +272,7 @@ namespace jsoncons { namespace csv {
JSONCONS_THROW(ser_error(json_errc::illegal_unicode_character,parser_.line(),parser_.column()));
}
std::size_t offset = (r.ptr - sv.data());
parser_.update(sv.data()+offset,sv.size()-offset);
parser_.set_buffer(sv.data()+offset,sv.size()-offset);
}

~legacy_basic_csv_reader() noexcept = default;
Expand Down Expand Up @@ -324,7 +324,7 @@ namespace jsoncons { namespace csv {
if (ec) return;
if (s.size() > 0)
{
parser_.update(s.data(),s.size());
parser_.set_buffer(s.data(),s.size());
}
}
parser_.parse_some(visitor_, ec);
Expand Down

0 comments on commit b7051c9

Please sign in to comment.