154 integer,
private :: format
165 type (csv_file),
private :: file_object_csv
248 logical :: is_success
249 is_success = this%file_object_csv%status
263 character(len=:),
allocatable :: name_file
264 name_file = this%file_object_csv%name
265 if ( len_trim(name_file)==0 ) this%file_object_csv%status = .
false.
282 unit_n = get_file_unit( this%file_object_csv%name, &
283 this%file_object_csv%status )
324 character(len=*),
intent(in) :: name
329 integer,
optional,
intent(in) :: format
332 integer :: format_def
336 this%file_object_csv%name = name
339 if (
present(format))
then
346 select case (format_def)
348 this%format = format_def
349 this%file_object_csv%status = .
true.
351 this%format = format_def
352 this%file_object_csv%status = .
true.
355 this%file_object_csv%status = .
false.
360 call csv_open_write( this%file_object_csv )
375 call csv_close( this%file_object_csv )
392 character(len=*),
optional,
intent(in) :: header
393 if (
present(header))
then
394 call csv_header_write( header, this%file_object_csv )
396 call csv_header_write(
"File " // this%file_object_csv%name, &
397 this%file_object_csv )
412 character(len=*),
intent(in) :: csv_record
413 call csv_record_write( csv_record, this%file_object_csv )
COMMONDATA – definitions of global constants and procedures.
logical, parameter, public true
Safety parameter avoid errors in logical values, so we can now refer to standard Fortran ....
logical, parameter, public false
Definition of high level file objects.
character(len=:) function, allocatable file_hangle_get_name_string(this)
Get the file name associated with the file handle. If the file name is (yet) undefined,...
logical function file_object_format_is_csv(this)
Check if the file format is CSV.
subroutine csv_close_this(this)
This is an object oriented wrapper for CSV_CLOSE(). For details see CSV_CLOSE.
logical function file_object_format_is_txt(this)
Check if the file format is CSV.
subroutine csv_open_write_this(this, name, format)
This is an object oriented wrapper for CSV_OPEN_WRITE(). For details see CSV_OPEN_WRITE.
integer function file_object_get_associated_unit(this)
A Low level function to get the Fortran unit number associated with the file handle object.
subroutine csv_header_line_write_this(this, header)
This is an object oriented wrapper for CSV_HEADER_WRITE(). See CSV_HEADER_WRITE for details.
subroutine csv_record_string_write_this(this, csv_record)
Physically write a single string CSV data record to the file. See CSV_RECORD_WRITE Example:
logical function file_operation_last_is_success(this)
Get the success or error status of the latest file operation. Example:
FILE_HANDLE is the basic file handle object. It provides an unitary object oriented interface for ope...