csv_import_status.anubis 1.41 KB
/*
 * Created by PyramIDE.
 * User: フランスのトトロ aka (David RENÉ) 
 * Date: 09/05/2017
 * Time: 23:01
 * © David RENÉ
 */


public type CSV_Import_Status:
  csv_ready,
  csv_in_progress,
  csv_finished,
  csv_paused,
  csv_cancelled,
  csv_file_not_found,
  csv_db_error,
  csv_bad_format,     // Bad format for input file
  csv_error.          // Unknown error

public define String
  to_String
  (
    CSV_Import_Status status
  )=
  if status is
  {
    csv_ready          then "READY",
    csv_in_progress    then "IN_PROGRESS",
    csv_finished       then "FINISHED",
    csv_paused         then "PAUSED",
    csv_cancelled      then "CANCELLED",
    csv_file_not_found then "FILE_NOT_FOUND",
    csv_db_error       then "DB_ERROR",
    csv_bad_format     then "BAD_FORMAT",
    csv_error          then "ERROR"
  }.
  
public define CSV_Import_Status
  to_CSV_Import_Status
  (
    String status
  )=
  if status = "READY"           then csv_ready else
  if status = "IN_PROGRESS"     then csv_in_progress else 
  if status = "FINISHED"        then csv_finished else 
  if status = "PAUSED"          then csv_paused else
  if status = "CANCELLED"       then csv_cancelled else
  if status = "FILE_NOT_FOUND"  then csv_file_not_found else
  if status = "DB_ERROR"        then csv_db_error else
  if status = "BAD_FORMAT"      then csv_bad_format else
  if status = "ERROR"           then csv_error else  
     csv_error
.