Vince's CSV Parser
Loading...
Searching...
No Matches
basic_csv_parser.hpp File Reference

Contains the main CSV parsing algorithm and various utility functions. More...

#include <algorithm>
#include <array>
#include <fstream>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <thread>
#include <vector>
#include "../external/mio.hpp"
#include "col_names.hpp"
#include "common.hpp"
#include "csv_format.hpp"
#include "csv_row.hpp"
#include "thread_safe_deque.hpp"

Go to the source code of this file.

Classes

class  csv::internals::IBasicCSVParser
 Abstract base class which provides CSV parsing logic. More...
 
class  csv::internals::StreamParser< TStream >
 A class for parsing CSV data from a std::stringstream or an std::ifstream More...
 
class  csv::internals::MmapParser
 Parser for memory-mapped files. More...
 

Namespaces

namespace  csv
 The all encompassing namespace.
 
namespace  csv::internals
 Stuff that is generally not of interest to end-users.
 

Typedefs

using csv::RowCollection = internals::ThreadSafeDeque< CSVRow >
 Standard type for storing collection of rows.
 

Functions

template<typename OutArray , typename T = typename OutArray::type>
CSV_CONST CONSTEXPR_17 OutArray csv::internals::arrayToDefault (T &&value)
 Helper constexpr function to initialize an array with all the elements set to value.
 
CSV_CONST CONSTEXPR_17 ParseFlagMap csv::internals::make_parse_flags (char delimiter)
 Create a vector v where each index i corresponds to the ASCII number for a character and, v[i + 128] labels it according to the CSVReader::ParseFlags enum.
 
CSV_CONST CONSTEXPR_17 ParseFlagMap csv::internals::make_parse_flags (char delimiter, char quote_char)
 Create a vector v where each index i corresponds to the ASCII number for a character and, v[i + 128] labels it according to the CSVReader::ParseFlags enum.
 
CSV_CONST CONSTEXPR_17 WhitespaceMap csv::internals::make_ws_flags (const char *ws_chars, size_t n_chars)
 Create a vector v where each index i corresponds to the ASCII number for a character c and, v[i + 128] is true if c is a whitespace character.
 
WhitespaceMap csv::internals::make_ws_flags (const std::vector< char > &flags)
 
size_t csv::internals::get_file_size (csv::string_view filename)
 
std::string csv::internals::get_csv_head (csv::string_view filename)
 
template<typename TStream , csv::enable_if_t< std::is_base_of< std::istream, TStream >::value, int > = 0>
std::string csv::internals::get_csv_head (TStream &source)
 
std::string csv::internals::get_csv_head (csv::string_view filename, size_t file_size)
 Read the first 500KB of a CSV file.
 

Variables

constexpr const int csv::internals::UNINITIALIZED_FIELD = -1
 

Detailed Description

Contains the main CSV parsing algorithm and various utility functions.

Definition in file basic_csv_parser.hpp.