rangeless::fn
rangeless::tsv Namespace Reference

Classes

class  get_next_line
 
struct  params
 
class  split_on_delim
 
class  to_num
 Utility to parse numbers. More...
 

Typedefs

using row_t = std::vector< std::string >
 

Functions

auto from (std::istream &istr, char delim='\t', params params={}) -> fn::impl::seq< fn::impl::transform< tsv::split_on_delim >::gen< fn::impl::catch_end< tsv::get_next_line > > >
 Read tab-separated-values from stream. More...
 

Typedef Documentation

◆ row_t

using rangeless::tsv::row_t = typedef std::vector<std::string>

Definition at line 4642 of file fn.hpp.

Function Documentation

◆ from()

auto rangeless::tsv::from ( std::istream &  istr,
char  delim = '\t',
params  params = {} 
) -> fn::impl::seq<fn::impl::transform<tsv::split_on_delim>::gen<fn::impl::catch_end<tsv::get_next_line> > >
inline

Read tab-separated-values from stream.

std::string result = "";
std::istringstream istr{"foo\n#comment\n\n\n bar \tbaz\n"};
for(const std::vector<std::string>& row : tsv::from(istr)) {
for(const auto& f : row) {
result += f;
result += "|";
}
result += ";";
});
VERIFY(result == "foo|;bar|baz|;");

Definition at line 4832 of file fn.hpp.