|
◆ csv_record_addfield_char()
subroutine, private file_utilities::csv_record_addfield_char |
( |
type(csv_record), intent(inout) |
this, |
|
|
character(len=*), intent(in) |
field, |
|
|
logical, intent(in), optional |
force_quote |
|
) |
| |
|
private |
Add a field from a CHARACTER variable to the csv record this.
The field will be quoted if necessary. - Da fare:
- Improve the trailing blank quoting.
- Parametri
-
[in,out] | this | object where to add field |
[in] | field | field to be added |
[in] | force_quote | if provided and .TRUE. , the field will be quoted even if not necessary |
Definizione alla linea 557 del file file_utilities.F90.
559 IF (this%csep /= record%csep .OR. this%cquote /= record%cquote) RETURN
560 CALL checkrealloc(this, record%cursor)
561 IF (this%nfield > 0) CALL add_byte(this, this%csep)
563 this%record(this%cursor+1:this%cursor+record%cursor) = &
564 record%record(1:record%cursor)
565 this%cursor = this%cursor + record%cursor
566 this%nfield = this%nfield + record%nfield
568 END SUBROUTINE csv_record_addfield_csv_record
573 FUNCTION csv_record_getrecord(this, nfield)
574 TYPE(csv_record), INTENT(IN) :: this
575 INTEGER, INTENT(out), OPTIONAL :: nfield
577 CHARACTER(len=this%cursor) :: csv_record_getrecord
579 csv_record_getrecord = transfer(this%record(1:this%cursor), csv_record_getrecord)
580 IF ( present(nfield)) nfield = this%nfield
582 END FUNCTION csv_record_getrecord
590 SUBROUTINE csv_record_getfield_char(this, field, flen, ier)
591 TYPE(csv_record), INTENT(INOUT) :: this
592 CHARACTER(len=*), INTENT(OUT), OPTIONAL :: field
594 INTEGER, INTENT(OUT), OPTIONAL :: flen
595 INTEGER, INTENT(OUT), OPTIONAL :: ier
597 LOGICAL :: inquote, inpre, inpost, firstquote
598 INTEGER :: i, ocursor, ofcursor
601 IF (csv_record_end(this)) THEN
602 IF ( PRESENT(field)) field = cmiss
603 IF ( PRESENT(ier)) THEN
606 CALL l4f_log(l4f_error, &
607 'in csv_record_getfield, attempt to read past end of record')
|