OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
opennn::CsvReader Class Reference

Tokenising CSV reader that returns string_views into a single backing buffer. More...

#include <io_utilities.h>

Classes

struct  Config
 Reader configuration: field separator and an optional per-line validator. More...
 
struct  Result
 Parsed CSV result; owns the source buffer that backs all row views. More...
 

Public Member Functions

 CsvReader (Config c)
 Constructs a reader with the given configuration.
 
Result read (const filesystem::path &path) const
 Reads and parses the CSV file at the given path.
 
Result read_string (string_view csv_text) const
 Parses a CSV string already held in memory.
 

Detailed Description

Tokenising CSV reader that returns string_views into a single backing buffer.

Constructor & Destructor Documentation

◆ CsvReader()

opennn::CsvReader::CsvReader ( Config c)
inlineexplicit

Constructs a reader with the given configuration.

Member Function Documentation

◆ read()

Result opennn::CsvReader::read ( const filesystem::path & path) const
nodiscard

Reads and parses the CSV file at the given path.

◆ read_string()

Result opennn::CsvReader::read_string ( string_view csv_text) const
nodiscard

Parses a CSV string already held in memory.