A class for tokenized reading of lines, that manages the file access.
An instance of this class holds the only reference to the file handle.
Construct a ManagingFileReader_t
If the argument echo_lines is present, then the read lines are
echoed to the unit echo_lines. If the argument is not present,
the echoing is switched off.
If err is not present, all errors will lead to a stop of the program.
Otherwise this argument contains the error code.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | file_name | |||
| integer, | intent(in), | optional | :: | echo_lines | ||
| integer, | intent(out), | optional | :: | err |
Close the file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(inout) | :: | this | |||
| logical, | intent(in), | optional | :: | delete |
Return if the next line can be read. It is written to the out-argument.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(inout) | :: | this | |||
| type(TokenIterator_t), | intent(out) | :: | tokenized_line | |||
| logical, | intent(in) | :: | skip_empty |
Rewind the file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(inout) | :: | this |
Set the unit where to echo lines.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(inout) | :: | this | |||
| integer, | intent(in), | optional | :: | echo_lines |
Return the current line (if defined)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(in) | :: | this |
Return the file name (if defined)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(in) | :: | this |
Return if a file is open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ManagingFileReader_t), | intent(in) | :: | this |