NEML2 1.4.0
|
A lazily parsed sequence of data. More...
A lazily parsed sequence of data.
This class is primarily designed to help parse CSV files, similar to neml2::CrossRef. Upon constuction, this object holds a single string without any further parser. The string can be parsed in one of two ways:
T. | In this mode, the string is simply parsed using utils::parse<std::vector<T>>. |
One apparent caveat is that if the underlying string is not space delimited and has the pattern "*.csv:*", it cannot be parsed into a std::vector<std::string>.
T |
#include <Sequence.h>
Public Member Functions | |
Sequence ()=default | |
Sequence< T > & | operator= (const std::string &other) |
Assignment operator. | |
operator std::vector< T > () const | |
Implicit conversion operator. | |
std::vector< T > | vec () const |
Convert to a vector. | |
bool | operator== (const Sequence< T > &other) const |
Test equality. | |
const std::string & | raw () const |
Get the raw string literal. | |
Friends | |
std::stringstream & | operator>> (std::stringstream &in, Sequence< T > &) |
Assignment operator.
This simply assigns the string without further parsing
std::vector< T > vec | ( | ) | const |
Convert to a vector.