Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#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 | |
FileLines & | operator= (const FileLines &)=delete |
~FileLines () | |
FileLineIterator | begin () |
FileLineIterator | end () const |
Definition at line 118 of file filelineiter.h.
|
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.
|
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.
|
delete |
|
inline |
Definition at line 161 of file filelineiter.h.
|
inline |
Definition at line 165 of file filelineiter.h.
|
inline |
Definition at line 167 of file filelineiter.h.