From b7051c9e38c0490378280a557829c7fba8a68b1b Mon Sep 17 00:00:00 2001 From: Daniel Parker Date: Tue, 12 Nov 2024 21:27:23 -0500 Subject: [PATCH] json_parser update -> set_buffer --- include/jsoncons/json_cursor.hpp | 8 ++++---- include/jsoncons_ext/csv/csv_cursor.hpp | 6 +++--- include/jsoncons_ext/csv/csv_reader.hpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/jsoncons/json_cursor.hpp b/include/jsoncons/json_cursor.hpp index 2b09d7171..adc2d092e 100644 --- a/include/jsoncons/json_cursor.hpp +++ b/include/jsoncons/json_cursor.hpp @@ -304,7 +304,7 @@ class basic_json_cursor : public basic_staj_cursor, 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()) @@ -354,7 +354,7 @@ class basic_json_cursor : public basic_staj_cursor, 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) @@ -372,7 +372,7 @@ class basic_json_cursor : public basic_staj_cursor, 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) { @@ -406,7 +406,7 @@ class basic_json_cursor : public basic_staj_cursor, 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; } } diff --git a/include/jsoncons_ext/csv/csv_cursor.hpp b/include/jsoncons_ext/csv/csv_cursor.hpp index 19ce225e0..62a8f0e38 100644 --- a/include/jsoncons_ext/csv/csv_cursor.hpp +++ b/include/jsoncons_ext/csv/csv_cursor.hpp @@ -281,7 +281,7 @@ class basic_csv_cursor : public basic_staj_cursor, 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(); @@ -297,7 +297,7 @@ class basic_csv_cursor : public basic_staj_cursor, 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); @@ -320,7 +320,7 @@ class basic_csv_cursor : public basic_staj_cursor, 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); diff --git a/include/jsoncons_ext/csv/csv_reader.hpp b/include/jsoncons_ext/csv/csv_reader.hpp index 858f65787..b30cfcfc2 100644 --- a/include/jsoncons_ext/csv/csv_reader.hpp +++ b/include/jsoncons_ext/csv/csv_reader.hpp @@ -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); @@ -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; @@ -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);