Vince's CSV Parser
Loading...
Searching...
No Matches
raw_csv_data.hpp
Go to the documentation of this file.
1
10#pragma once
11
12#include <memory>
13
14#include "col_names.hpp"
15#include "common.hpp"
16#include "memory/constants.hpp"
17#include "memory/field_scalar_list.hpp"
18#include "memory/quote_arena.hpp"
19#include "memory/raw_csv_field.hpp"
20#include "memory/raw_csv_field_list.hpp"
21
22namespace csv {
23 namespace internals {
24 class JsonConverter;
25
26 using memory::INVALID_REALIZED_OFFSET;
27 using memory::CSVFieldScalarList;
28 using memory::RawCSVField;
29 using memory::RawCSVFieldList;
30 using memory::RawCSVQuoteArena;
31
37 struct RawCSVData {
38 std::shared_ptr<void> _data = nullptr;
39 csv::string_view data = "";
40
41 internals::RawCSVFieldList fields;
42
44 internals::CSVFieldScalarList field_scalars;
45
47 internals::RawCSVQuoteArena quote_arena;
48
50 mutable internals::lazy_shared_ptr<JsonConverter> json_converter;
51
52 internals::ColNamesPtr col_names = nullptr;
53 internals::ParseFlagMap parse_flags;
55
59 bool has_ws_trimming = false;
60
61 bool has_field_scalars() const noexcept {
62 return !this->field_scalars.empty();
63 }
64 };
65
66 using RawCSVDataPtr = std::shared_ptr<RawCSVData>;
67 }
68}
A standalone header file containing shared code.
std::array< ParseFlags, 256 > ParseFlagMap
An array which maps ASCII chars to a parsing flag.
Definition common.hpp:472
std::array< bool, 256 > WhitespaceMap
An array which maps ASCII chars to a flag indicating if it is whitespace.
Definition common.hpp:475
The all encompassing namespace.
std::string_view string_view
The string_view class used by this library.
Definition common.hpp:174
A class for storing raw CSV data and associated metadata.
internals::RawCSVQuoteArena quote_arena
Parser-time sidecar bytes for fields whose quoted contents contained doubled quotes.
bool has_ws_trimming
True when at least one whitespace trim character is configured.
internals::lazy_shared_ptr< JsonConverter > json_converter
Cached JSON converter for rows sharing this parsed backing storage.
internals::CSVFieldScalarList field_scalars
Optional parser-time scalar sidecar; empty unless eager classification is enabled.