ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe::io_dsv_impl::DsvReader< Delimiter > Class Template Reference

Read arbitrary data as delimiter-separated values from a text file. More...

#include <acts/blob/master/thirdparty/dfelibs/dfe/dfe_io_dsv.hpp>

+ Collaboration diagram for dfe::io_dsv_impl::DsvReader< Delimiter >:

Public Member Functions

 DsvReader ()=delete
 
 DsvReader (const DsvReader &)=delete
 
 DsvReader (DsvReader &&)=default
 
 ~DsvReader ()=default
 
DsvReaderoperator= (const DsvReader &)=delete
 
DsvReaderoperator= (DsvReader &&)=default
 
 DsvReader (const std::string &path)
 
bool read (std::vector< std::string > &columns)
 
std::size_t num_lines () const
 Return the number of lines read so far.
 

Private Attributes

std::ifstream m_file
 
std::string m_line
 
std::size_t m_num_lines = 0
 

Detailed Description

template<char Delimiter>
class dfe::io_dsv_impl::DsvReader< Delimiter >

Read arbitrary data as delimiter-separated values from a text file.

Definition at line 92 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 92 of file dfe_io_dsv.hpp

Constructor & Destructor Documentation

template<char Delimiter>
dfe::io_dsv_impl::DsvReader< Delimiter >::DsvReader ( )
delete
template<char Delimiter>
dfe::io_dsv_impl::DsvReader< Delimiter >::DsvReader ( const DsvReader< Delimiter > &  )
delete
template<char Delimiter>
dfe::io_dsv_impl::DsvReader< Delimiter >::DsvReader ( DsvReader< Delimiter > &&  )
default
template<char Delimiter>
dfe::io_dsv_impl::DsvReader< Delimiter >::~DsvReader ( )
default
template<char Delimiter>
dfe::io_dsv_impl::DsvReader< Delimiter >::DsvReader ( const std::string &  path)
inline

Open a file at the given path.

Parameters
pathPath to the input file

Definition at line 346 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 346 of file dfe_io_dsv.hpp

References dfe::io_dsv_impl::DsvReader< Delimiter >::m_file.

Member Function Documentation

template<char Delimiter>
std::size_t dfe::io_dsv_impl::DsvReader< Delimiter >::num_lines ( ) const
inline

Return the number of lines read so far.

Definition at line 113 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 113 of file dfe_io_dsv.hpp

References dfe::io_dsv_impl::DsvReader< Delimiter >::m_num_lines.

template<char Delimiter>
DsvReader& dfe::io_dsv_impl::DsvReader< Delimiter >::operator= ( const DsvReader< Delimiter > &  )
delete
template<char Delimiter>
DsvReader& dfe::io_dsv_impl::DsvReader< Delimiter >::operator= ( DsvReader< Delimiter > &&  )
default
template<char Delimiter>
bool dfe::io_dsv_impl::DsvReader< Delimiter >::read ( std::vector< std::string > &  columns)
inline

Read the next line from the file.

Returns
true if the line was successfully read
false if no more lines are available

Definition at line 355 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 355 of file dfe_io_dsv.hpp

References pos(), and nlohmann::to_string().

+ Here is the call graph for this function:

Member Data Documentation

template<char Delimiter>
std::ifstream dfe::io_dsv_impl::DsvReader< Delimiter >::m_file
private

Definition at line 116 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 116 of file dfe_io_dsv.hpp

Referenced by dfe::io_dsv_impl::DsvReader< Delimiter >::DsvReader().

template<char Delimiter>
std::string dfe::io_dsv_impl::DsvReader< Delimiter >::m_line
private

Definition at line 117 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 117 of file dfe_io_dsv.hpp

template<char Delimiter>
std::size_t dfe::io_dsv_impl::DsvReader< Delimiter >::m_num_lines = 0
private

Definition at line 118 of file dfe_io_dsv.hpp.

View newest version in sPHENIX GitHub at line 118 of file dfe_io_dsv.hpp

Referenced by dfe::io_dsv_impl::DsvReader< Delimiter >::num_lines().


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