14 namespace til {
namespace io
38 std::size_t
nlines()
const {
return m_linecount; }
40 std::size_t
ncolumns()
const {
return m_columncount; }
49 void operator()(
const std::string & filename) { (*this)(filename.c_str()); }
52 std::size_t m_linecount, m_columncount;
61 std::pair<std::size_t, std::size_t>
62 get_array_size(
const char * filename, std::size_t maxLineLength = 65536);
70 template <
typename TIterator,
typename TProgressIndicator = NoIndicator >
83 m_buffer.resize(maxlinelength);
94 void operator()(
const char * filename, TIterator begin);
98 void operator()(
const std::string & filename, TIterator begin);
102 TProgressIndicator m_indicator;
106 std::string m_buffer;
110 template <
typename TIterator >
111 void simple_load(
const char * filename, TIterator begin, std::size_t maxlinelength = 65536)
114 loader(filename, begin);
GetArraySize(std::size_t maxlinelength)
SimpleLoader(std::size_t maxlinelength)
Construct object, giving maximum length, in characters, of a line on file.
std::pair< std::size_t, std::size_t > get_array_size(const char *filename, std::size_t maxLineLength=65536)
Returns the number of row and columns in an array file.
TProgressIndicator & progress_indicator()
void operator()(const char *filename)
Scan file to extract size information.
void setMaxLineLength(std::size_t mll)
Belongs to package Box Do not include directly, include til/Box.h instead.
std::size_t nlines() const
Returns the number of lines.
Return the number of row and columns of an array in a text file.
std::size_t ncolumns() const
Returns the number of columns.
void operator()(const std::string &filename)
Scan file to extract size information.
void simple_load(const char *filename, TIterator begin, std::size_t maxlinelength=65536)