Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
FileLines Class Reference

#include <filelineiter.h>

Public Member Functions

 FileLines (absl::string_view filename, File *const file, const int options=FileLineIterator::DEFAULT)
 
 FileLines (absl::string_view filename, int options=FileLineIterator::DEFAULT)
 
 FileLines (const FileLines &)=delete
 
FileLinesoperator= (const FileLines &)=delete
 
 ~FileLines ()
 
FileLineIterator begin ()
 
FileLineIterator end () const
 

Detailed Description

Definition at line 118 of file filelineiter.h.

Constructor & Destructor Documentation

◆ FileLines() [1/3]

FileLines::FileLines ( absl::string_view filename,
File *const file,
const int options = FileLineIterator::DEFAULT )
inline

Initializes with a provided file, taking ownership of it.

If file is nullptr, this class behaves as if the file was empty.

Usage:

File* file = nullptr; RETURN_IF_ERROR(file::Open(filename, "r", &file, file::Defaults())); for (const absl::string_view line : FileLines(filename, file)) { ... }

Definition at line 132 of file filelineiter.h.

◆ FileLines() [2/3]

FileLines::FileLines ( absl::string_view filename,
int options = FileLineIterator::DEFAULT )
inlineexplicit

Initializes the FileLines ignoring errors.

Please prefer the other constructor combined with file::Open() in new code so that missing files are properly detected. This version would only print a warning and act as if the file was empty.

Definition at line 145 of file filelineiter.h.

◆ FileLines() [3/3]

FileLines::FileLines ( const FileLines & )
delete

◆ ~FileLines()

FileLines::~FileLines ( )
inline

Definition at line 161 of file filelineiter.h.

Member Function Documentation

◆ begin()

FileLineIterator FileLines::begin ( )
inline

Definition at line 165 of file filelineiter.h.

◆ end()

FileLineIterator FileLines::end ( ) const
inline

Definition at line 167 of file filelineiter.h.

◆ operator=()

FileLines & FileLines::operator= ( const FileLines & )
delete

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