ROOT
ROOT project
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
ReaderCSV Class Reference

Reader class for CSV files. More...

#include <reader.hpp>

Inheritance diagram for ReaderCSV:
Inheritance graph
Collaboration diagram for ReaderCSV:
Collaboration graph

Public Member Functions

std::unique_ptr< ConfigBaseread (CLI::App *app, bool verbose) override
 Method to read the configuration from the CSV file.
 
- Public Member Functions inherited from ReaderBase
virtual ~ReaderBase ()=default
 Virtual destructor for ReaderBase.
 

Private Member Functions

std::vector< std::string > splitCsvLine (const std::string &line) const
 Helper method to split a CSV line into individual fields.
 

Friends

class ReaderCSVTester
 Friend test fixture class for unit testing.
 

Additional Inherited Members

- Public Attributes inherited from ReaderBase
std::string filename
 The input filename to read from.
 
char sep
 Field separator character.
 
char quote
 Quote/delimiter character.
 
- Static Protected Member Functions inherited from ReaderBase
static std::string trim (const std::string &untrimmed_str)
 Helper static method to trim leading and trailing whitespace from a string.
 
static bool parseBool (const std::string &bool_str, bool &out)
 Helper static method to parse a boolean value from a string.
 
static bool parseDouble (const std::string &double_str, double &out)
 Helper static method to parse a double value from a string.
 
static bool parseInt (const std::string &int_str, int &out)
 Helper static method to parse an integer value from a string.
 
static bool parseMethod (const std::string &method_str, Method &out)
 Helper static method to parse a Method enum value from a string.
 
static std::unique_ptr< ConfigBasemake_config_from_map (const std::unordered_map< std::string, std::string > &config_map)
 Helper static method to create a ConfigBase object from a map of string key-value pairs.
 

Detailed Description

Reader class for CSV files.

This class extends ReaderBase and implements reading configuration data from CSV files.

Member Function Documentation

◆ read()

std::unique_ptr< ConfigBase > ReaderCSV::read ( CLI::App *  app,
bool  verbose 
)
overridevirtual

Method to read the configuration from the CSV file.

Parameters
appThe CLI app subcommand containing the options for the CSV input.
Returns
A unique pointer to a ConfigBase object representing the read configuration.

Implements ReaderBase.

Here is the call graph for this function:

◆ splitCsvLine()

std::vector< std::string > ReaderCSV::splitCsvLine ( const std::string &  line) const
private

Helper method to split a CSV line into individual fields.

Parameters
lineThe input CSV line.
Returns
A vector of strings representing the individual fields.
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ReaderCSVTester

friend class ReaderCSVTester
friend

Friend test fixture class for unit testing.


The documentation for this class was generated from the following files: