CSVAsyncTask๏ƒ

Inherits: RefCounted < Object

Asynchronous CSV and DSV load/save task.

Description๏ƒ

CSVAsyncTask runs CSV or DSV load/save work on a background thread. Use the static constructors to configure a task, call start(), then poll state or wait with wait_to_finish(). Load tasks expose rows with get_rows() and get_table().

Methods๏ƒ

void

cancel()

String

get_error() const

float

get_progress() const

Array

get_rows() const

CSVTable

get_table() const

bool

is_cancelled() const

bool

is_done() const

bool

is_running() const

CSVAsyncTask

load_csv(path: String, delimiter: String = ",", headers: bool = false, cast_fields: bool = true, options: Dictionary = {}) static

CSVAsyncTask

load_dsv(path: String, delimiter: String = ",", options: Dictionary = {}) static

CSVAsyncTask

save_csv(path: String, rows: Array, delimiter: String = ",", headers: bool = false, options: Dictionary = {}) static

CSVAsyncTask

save_dsv(path: String, rows: Array, delimiter: String = ",") static

Error

start()

void

wait_to_finish()


Signals๏ƒ

cancelled() ๐Ÿ”—

Emitted when the task finishes due to cancellation.


completed() ๐Ÿ”—

Emitted when the task finishes successfully.


failed(error: String) ๐Ÿ”—

Emitted when the task fails.


progress_changed(progress: float) ๐Ÿ”—

Emitted when task progress changes.


Method Descriptions๏ƒ

void cancel() ๐Ÿ”—

Requests cancellation. The task stops between row operations.


String get_error() const ๐Ÿ”—

Returns the task error message, or an empty string when no error occurred.


float get_progress() const ๐Ÿ”—

Returns progress in the range 0.0 to 1.0.


Array get_rows() const ๐Ÿ”—

Returns loaded rows for load tasks. Save tasks return an empty array.


CSVTable get_table() const ๐Ÿ”—

Returns loaded rows wrapped in a CSVTable.


bool is_cancelled() const ๐Ÿ”—

Returns true if the task finished due to cancellation.


bool is_done() const ๐Ÿ”—

Returns true when the task has finished, failed, or been cancelled.


bool is_running() const ๐Ÿ”—

Returns true while the background thread is active.


CSVAsyncTask load_csv(path: String, delimiter: String = ",", headers: bool = false, cast_fields: bool = true, options: Dictionary = {}) static ๐Ÿ”—

Creates a task that loads typed CSV rows from path.


CSVAsyncTask load_dsv(path: String, delimiter: String = ",", options: Dictionary = {}) static ๐Ÿ”—

Creates a task that loads raw DSV rows from path.


CSVAsyncTask save_csv(path: String, rows: Array, delimiter: String = ",", headers: bool = false, options: Dictionary = {}) static ๐Ÿ”—

Creates a task that saves CSV rows to path. options may include header_names, color_as_hex, and hex_include_alpha.


CSVAsyncTask save_dsv(path: String, rows: Array, delimiter: String = ",") static ๐Ÿ”—

Creates a task that saves raw DSV rows to path.


Error start() ๐Ÿ”—

Starts the background task.


void wait_to_finish() ๐Ÿ”—

Blocks until the background thread finishes. This is useful for tests or command-line workflows.