An abstract class that supports tokenized reading of lines.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | file_id | ||||
| integer, | private, | allocatable | :: | echo_lines | |||
| character(len=:), | private, | allocatable | :: | file_name |
The file name of the open file (if available). |
||
| integer, | private, | allocatable | :: | current_line |
The current line (if available). The number refers to the line
just returned from |
Return if the next line can be read and return it
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(FileReader_t), | intent(inout) | :: | this | |||
| character(len=:), | intent(out), | allocatable | :: | line |
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 |