19 const ColNamesPtr& col_names =
nullptr,
23 : serial_parser_(parse_flags, ws_flags, col_names)
25 , parse_flags_(parse_flags),
32 if (format.is_threading_enabled()
35 n_threads = format.get_speculative_parallel_threads();
68 size_t worker_count()
const noexcept override {
83 return this->speculative_diagnostics_;
87 size_t read_window_size(
size_t chunk_size)
const noexcept override {
93 const size_t max_size = (std::numeric_limits<size_t>::max)();
104 bool utf8_bom()
const noexcept override {
105 return this->utf8_bom_;
109 this->serial_parser_.reset_with_initial_state(
state);
113 return this->serial_parser_.ending_state();
118 std::shared_ptr<void> owner,
138 if (!this->bom_scanned_) {
139 bom_skip = get_bom_skip(chunk, this->utf8_bom_, error);
140 if (error)
return {};
141 this->bom_scanned_ =
true;
158#if CSV_ENABLE_THREADS
170 std::shared_ptr<void> owner,
176#if CSV_ENABLE_THREADS
194 return this->parse_serial_window(
205 std::shared_ptr<void> owner,
217 result.complete_prefix_length = parse_result.complete_prefix_length;
219 this->serial_parser_.end_feed();
224#if CSV_ENABLE_THREADS
227 std::shared_ptr<void> owner,
234 auto chunks = speculative::make_speculative_parse_chunks(
242 const speculative::ParallelCSVParseResult parse_result = this->
speculative_parser_->parse_chunks(
248 result.complete_prefix_length = parse_result.complete_prefix_length;
250 this->speculative_diagnostics_.merge(parse_result.diagnostics);
262#if CSV_ENABLE_THREADS
268 bool bom_scanned_ =
false;
269 bool utf8_bom_ =
false;
270#if CSV_ENABLE_THREADS
273 speculative::SpeculativeScanner
scanner_;