Easy3D 2.6.1
Loading...
Searching...
No Matches
LineInputStream Class Reference

Input stream class to operate on ASCII files. More...

#include <easy3d/util/line_stream.h>

Public Member Functions

 LineInputStream (std::istream &in)
 Constructor.
 
 ~LineInputStream ()
 Destructor.
 
bool eof () const
 Check if the end of the file has been reached.
 
bool eol () const
 Check if the end of the line has been reached.
 
bool fail () const
 Check if the stream has failed.
 
void get_line ()
 Read the next line from the input stream.
 
std::istream & line ()
 Get the current line as an input stream.
 
const std::string & current_line () const
 Get the current line as a string.
 
template<class T>
LineInputStreamoperator>> (T &param)
 Extract a value from the current line.
 

Detailed Description

Input stream class to operate on ASCII files.

Constructor & Destructor Documentation

◆ LineInputStream()

LineInputStream ( std::istream & in)
inlineexplicit

Constructor.

Parameters
inThe input stream.

Member Function Documentation

◆ current_line()

const std::string & current_line ( ) const
inline

Get the current line as a string.

Returns
The current line as a string.

◆ eof()

bool eof ( ) const
inline

Check if the end of the file has been reached.

Returns
True if the end of the file has been reached, false otherwise.

◆ eol()

bool eol ( ) const
inline

Check if the end of the line has been reached.

Returns
True if the end of the line has been reached, false otherwise.

◆ fail()

bool fail ( ) const
inline

Check if the stream has failed.

Returns
True if the stream has failed, false otherwise.

◆ line()

std::istream & line ( )
inline

Get the current line as an input stream.

Returns
The current line as an input stream.

◆ operator>>()

template<class T>
LineInputStream & operator>> ( T & param)
inline

Extract a value from the current line.

Template Parameters
TThe type of the value to extract.
Parameters
paramThe value to extract.
Returns
A reference to the LineInputStream object.

The documentation for this class was generated from the following file: