illumina::interop::io::table Namespace Reference

Functions

template<typename T >
void read_csv_line (std::istream &in, std::vector< T > &values, const T missing=T())
 
template<typename T >
read_value (std::istream &in, std::string &buf, const char delim=',')
 
template<typename T >
void read_value (std::istream &in, T &dest, std::string &buf, const char delim=',')
 
template<typename I >
void read_csv (std::istream &in, I beg, I end, const char delim=',')
 
template<class T >
const T & handle_nan (const T &val)
 
float handle_nan (const float val)
 
double handle_nan (const double val)
 
template<typename I >
void write_csv (std::ostream &out, I beg, I end, const char eol, const size_t precision=10)
 
template<typename T >
void write_csv_line (std::ostream &out, const std::vector< T > &values, const size_t beg=0, size_t last=0)
 

Function Documentation

const T& illumina::interop::io::table::handle_nan ( const T &  val)
inline

Ignore non-float values

float illumina::interop::io::table::handle_nan ( const float  val)
inline

Ensure we get consistent NaNs

Parameters
valfloat value
Returns
float value
double illumina::interop::io::table::handle_nan ( const double  val)
inline

Ensure we get consistent NaNs

Parameters
valfloat value
Returns
float value
void illumina::interop::io::table::read_csv ( std::istream &  in,
beg,
end,
const char  delim = ',' 
)

Read a csv values into a preallocated buffer

Parameters
ininput stream
begstart of the buffer
endend of the buffer
delimdeliminator
void illumina::interop::io::table::read_csv_line ( std::istream &  in,
std::vector< T > &  values,
const T  missing = T() 
)

Read a vector of values from a single in a CSV file

Parameters
ininput stream
valuesdestination vector
missingsentinel for missing values
T illumina::interop::io::table::read_value ( std::istream &  in,
std::string &  buf,
const char  delim = ',' 
)

Read delimited value from the input stream and cast to proper destination type

Parameters
ininput stream
bufreusable buffer
delimdeliminator
Returns
destintion value
void illumina::interop::io::table::read_value ( std::istream &  in,
T &  dest,
std::string &  buf,
const char  delim = ',' 
)

Read delimited value from the input stream and cast to proper destination type

Parameters
ininput stream
destdestination type
bufreusable buffer
delimdeliminator
void illumina::interop::io::table::write_csv ( std::ostream &  out,
beg,
end,
const char  eol,
const size_t  precision = 10 
)

Write a vector of values as a single in a CSV file

Parameters
outoutput stream
begiterator to start of collection
enditerator to end of collection
eolend of line terminator character
precisionnumber of digits for floating point number
void illumina::interop::io::table::write_csv_line ( std::ostream &  out,
const std::vector< T > &  values,
const size_t  beg = 0,
size_t  last = 0 
)

Write a vector of values as a single in a CSV file

Parameters
outoutput stream
valuessource vector of values
begstart column offset
lastlast column offset