Vince's CSV Parser
basic_csv_parser.hpp File Reference

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

#include <algorithm>
#include <array>
#include <condition_variable>
#include <deque>
#include <fstream>
#include <memory>
#include <mutex>
#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"

Go to the source code of this file.

Classes

class  csv::internals::ThreadSafeDeque< T >
 A std::deque wrapper which allows multiple read and write threads to concurrently access it along with providing read threads the ability to wait for the deque to become populated. More...
 
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

 csv
 The all encompassing 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

HEDLEY_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.
 
HEDLEY_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.
 
HEDLEY_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)
 
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.