Tkrzw
Public Member Functions | List of all members
tkrzw::FileReader Class Reference

File reader. More...

#include <tkrzw_file_util.h>

Public Member Functions

 FileReader (File *file)
 Constructor. More...
 
Status ReadLine (std::string *str, size_t max_size=0)
 Reads a line. More...
 

Detailed Description

File reader.

Constructor & Destructor Documentation

◆ FileReader()

tkrzw::FileReader::FileReader ( File file)
explicit

Constructor.

Parameters
fileA file object to read. Ownership is not taken.

Member Function Documentation

◆ ReadLine()

Status tkrzw::FileReader::ReadLine ( std::string *  str,
size_t  max_size = 0 
)

Reads a line.

Parameters
strThe pointer to a string object which stores the result.
max_sizeThe maximum size of data to read. 0 means unlimited.
Returns
The result status. NOT_FOUND_ERROR is returned at the end of file.