Skip to content

Commit ced679b

Browse files
committed
csv cursor
1 parent 7138336 commit ced679b

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

include/jsoncons/decode_traits.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ namespace jsoncons {
190190
{
191191
v.push_back(decode_traits<value_type,CharT>::decode(cursor, decoder, ec));
192192
if (ec) {return T{};}
193-
std::cout << "read next 10\n";
194-
//cursor.next(ec);
193+
//std::cout << "read next 10\n";
194+
cursor.next(ec);
195195
}
196196
return v;
197197
}
@@ -480,7 +480,7 @@ namespace jsoncons {
480480
{
481481
v.insert(decode_traits<value_type,CharT>::decode(cursor, decoder, ec));
482482
if (ec) {return T{};}
483-
std::cout << "cursor.next 20\n";
483+
//std::cout << "cursor.next 20\n";
484484
cursor.next(ec);
485485
if (ec) {return T{};}
486486
}
@@ -527,7 +527,7 @@ namespace jsoncons {
527527
{
528528
v[i] = decode_traits<value_type,CharT>::decode(cursor, decoder, ec);
529529
if (ec) {return v;}
530-
std::cout << "cursor.next 100\n";
530+
//std::cout << "cursor.next 100\n";
531531
cursor.next(ec);
532532
if (ec) {return v;}
533533
}
@@ -574,12 +574,12 @@ namespace jsoncons {
574574
}
575575
auto key = cursor.current().template get<key_type>(ec);
576576
if (ec) {return val;}
577-
std::cout << "cursor.next 200\n";
577+
//std::cout << "cursor.next 200\n";
578578
cursor.next(ec);
579579
if (ec) {return val;}
580580
val.emplace(std::move(key),decode_traits<mapped_type,CharT>::decode(cursor, decoder, ec));
581581
if (ec) {return val;}
582-
std::cout << "cursor.next 300\n";
582+
//std::cout << "cursor.next 300\n";
583583
cursor.next(ec);
584584
if (ec) {return val;}
585585
}
@@ -640,12 +640,12 @@ namespace jsoncons {
640640
ec = json_errc::invalid_number;
641641
return val;
642642
}
643-
std::cout << "cursor.next 500\n";
643+
//std::cout << "cursor.next 500\n";
644644
cursor.next(ec);
645645
if (ec) {return val;}
646646
val.emplace(n, decode_traits<mapped_type,CharT>::decode(cursor, decoder, ec));
647647
if (ec) {return val;}
648-
std::cout << "cursor.next 600\n";
648+
//std::cout << "cursor.next 600\n";
649649
cursor.next(ec);
650650
if (ec) {return val;}
651651
}

include/jsoncons_ext/csv/csv_cursor.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,11 @@ class basic_csv_cursor : public basic_staj_cursor<CharT>, private virtual ser_co
225225
void read_to(basic_json_visitor<CharT>& visitor,
226226
std::error_code& ec) override
227227
{
228+
basic_json_tee<char_type> tee(cursor_visitor_, visitor);
228229
if (cursor_visitor_.event().send_json_event(visitor, *this, ec))
229230
{
230-
read_next(visitor, ec);
231-
read_next(ec);
231+
read_next(tee, ec);
232+
//read_next(ec);
232233
}
233234
}
234235

test/csv/src/csv_cursor_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ EUR_LIBOR_06M,2015-10-27,0.0000001
144144
REQUIRE(cursor.current().event_type() == staj_event_type::begin_object);
145145
cursor.read_to(decoder);
146146

147-
//REQUIRE(cursor.current().event_type() == staj_event_type::end_object);
148-
//cursor.next();
147+
REQUIRE(cursor.current().event_type() == staj_event_type::end_object);
148+
cursor.next();
149149

150150
REQUIRE(cursor.current().event_type() == staj_event_type::begin_object);
151151
cursor.next();

0 commit comments

Comments
 (0)