OFF file object definition and implementation.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=I4P), | public, | parameter | :: | ERROR_ALREADY_CONNECTED | = | 1 | Already connected error code. |
integer(kind=I4P), | public, | parameter | :: | ERROR_NOT_CONNECTED | = | 2 | Not connected error code. |
integer(kind=I4P), | public, | parameter | :: | ERROR_NOT_INITIALIZED | = | 3 | Not initialized error code. |
character(len=5), | private, | parameter | :: | UNSET_FILE_NAME | = | 'unset' | Default, unset file name. |
File object class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(error_object), | public | :: | error | Errors handler. |
|||
character(len=:), | public, | allocatable | :: | file_name | File name. |
||
integer(kind=I4P), | public | :: | file_unit | = | 0 | File unit. |
|
logical, | public | :: | is_connected | = | .false. | Sentinel to check if file is connected. |
|
logical, | public | :: | is_initialized | = | .false. | Sentinel to check if file is initialized. |
generic, public :: assignment(=) => file_assign_file | Overload |
procedure, public, pass(self) :: close | Close file. |
procedure, public, pass(self) :: description | Return a pretty-formatted description of the file. |
procedure, public, pass(self) :: destroy | Destroy file. |
procedure, public, pass(lhs) :: file_assign_file | Operator |
procedure, public, pass(self) :: initialize | Initialize file. |
procedure, public, pass(self) :: load_file_name_from_file | Load file name from file. |
procedure, public, pass(self) :: open | Open file. |
procedure, public, pass(self) :: save_file_name_into_file | Save file name into file. |
Return a pretty-formatted description of the file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(in) | :: | self | Files collection. |
||
character(len=*), | intent(in), | optional | :: | prefix | Prefixing string. |
Description.
Close file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
Destroy file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
Operator =
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | lhs | Left hand side. |
||
type(file_object), | intent(in) | :: | rhs | Right hand side. |
Initialize File.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
||
character(len=*), | intent(in), | optional | :: | file_name | File name. |
Load file name from file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
||
type(file_ini), | intent(in) | :: | fini | Simulation parameters ini file handler. |
||
character(len=*), | intent(in) | :: | section_name | Option name into the ini file. |
||
character(len=*), | intent(in) | :: | option_name | Option name into the ini file. |
||
logical, | intent(in), | optional | :: | go_on_fail | Go on if load fails. |
Open file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
||
character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
character(len=*), | intent(in), | optional | :: | format | File format. |
|
character(len=*), | intent(in), | optional | :: | action | File action. |
|
character(len=*), | intent(in), | optional | :: | access | File access. |
Save file name into file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_object), | intent(inout) | :: | self | File object. |
||
type(file_ini), | intent(inout) | :: | fini | Simulation parameters ini file handler. |
||
character(len=*), | intent(in) | :: | section_name | Option name into the ini file. |
||
character(len=*), | intent(in) | :: | option_name | Option name into the ini file. |