ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Go to the documentation of this file.
31 T
operator[](std::size_t index)
const {
return fData.at(index); }
32 std::size_t
size()
const {
return fData.size(); }
33 const std::string &
getLine()
const {
return fLine; }
38 std::getline(stream, fLine);
39 std::istringstream str(fLine);
40 for (std::string elem; std::getline(str, elem,
',');) {
41 std::istringstream ss(elem);
45 fData.emplace_back(obj);
66 std::istream *fStream;
70 CSVIterator(std::istream &stream) : fStream(stream.good() ? &stream : nullptr) { ++(*this); }
77 if (!((*fStream) >> fRow)) {
95 return ((
this == &rhs) || ((this->fStream ==
nullptr) && (rhs.fStream ==
nullptr)));
101 template <
typename T>
104 std::istream &fStream;
112 #endif //#ifndef ATCSVREADER_H
Range class for CSVIterator.
CSVRow< T > const * operator->() const
bool operator==(CSVIterator const &rhs)
CSVIterator(std::istream &stream)
const std::string & getLine() const
CSVIterator< T > begin() const
A simple CSV reader w/ modern cpp features.
T operator[](std::size_t index) const
CSVIterator & operator++()
CSVIterator & operator++(int)
void readNextLine(std::istream &stream)
CSVRange(std::istream &str)
std::istream & operator>>(std::istream &stream, CSVRow< T > &data)
Method to stream into this type of object.
CSVRow< T > const & operator*() const
bool operator!=(CSVIterator const &rhs)
CSVIterator< T > end() const