| 372 | } // namespace |
| 373 | |
| 374 | std::unique_ptr<Chunker> MakeChunker(const ParseOptions& options) { |
| 375 | std::shared_ptr<BoundaryFinder> delimiter; |
| 376 | if (!options.newlines_in_values) { |
| 377 | delimiter = MakeNewlineBoundaryFinder(); |
| 378 | } else { |
| 379 | if (options.quoting) { |
| 380 | if (options.escaping) { |
| 381 | delimiter = std::make_shared< |
| 382 | LexingBoundaryFinder<internal::SpecializedOptions<true, true>>>(options); |
| 383 | } else { |
| 384 | delimiter = std::make_shared< |
| 385 | LexingBoundaryFinder<internal::SpecializedOptions<true, false>>>(options); |
| 386 | } |
| 387 | } else { |
| 388 | if (options.escaping) { |
| 389 | delimiter = std::make_shared< |
| 390 | LexingBoundaryFinder<internal::SpecializedOptions<false, true>>>(options); |
| 391 | } else { |
| 392 | delimiter = std::make_shared< |
| 393 | LexingBoundaryFinder<internal::SpecializedOptions<false, false>>>(options); |
| 394 | } |
| 395 | } |
| 396 | } |
| 397 | return std::make_unique<Chunker>(std::move(delimiter)); |
| 398 | } |
| 399 | |
| 400 | } // namespace csv |
| 401 | } // namespace arrow |