14 this->possible_delimiters = { delim };
15 this->assert_no_char_overlap();
20 this->possible_delimiters = delim;
21 this->assert_no_char_overlap();
26 this->no_quote =
false;
27 this->quote_char =
quote;
28 this->assert_no_char_overlap();
33 this->trim_chars = chars;
34 this->assert_no_char_overlap();
39 this->col_names = names;
41 this->col_names_explicitly_set_ =
true;
46 if (row < 0) this->variable_column_policy = VariableColumnPolicy::KEEP;
49 this->header_explicitly_set_ =
true;
51 this->col_names_explicitly_set_ =
false;
56 if (size < internals::CSV_CHUNK_SIZE_FLOOR) {
57 throw std::invalid_argument(internals::make_chunk_size_error(internals::CSV_CHUNK_SIZE_FLOOR, size));
59 const size_t max_chunk_size = (std::numeric_limits<std::uint32_t>::max)();
60 if (size > max_chunk_size) {
61 throw std::invalid_argument(internals::make_chunk_size_ceiling_error(max_chunk_size, size));
63 this->_chunk_size = size;
67 CSV_INLINE void CSVFormat::assert_no_char_overlap()
69 const std::set<char> delims(this->possible_delimiters.begin(), this->possible_delimiters.end());
70 const std::set<char> trims(this->trim_chars.begin(), this->trim_chars.end());
71 std::set<char> offenders;
73 for (std::set<char>::const_iterator it = delims.begin(); it != delims.end(); ++it) {
74 if (trims.find(*it) != trims.end()) {
75 offenders.insert(*it);
81 if (delims.find(this->quote_char) != delims.end() ||
82 trims.find(this->quote_char) != trims.end()) {
83 offenders.insert(this->quote_char);
86 if (!offenders.empty()) {
87 throw std::runtime_error(internals::make_char_overlap_error(offenders));
#define CSV_INLINE
Helper macro which should be #defined as "inline" in the single header version.
The all encompassing namespace.