new_file


Description:

public static DataModel new_file (string filename, bool random_access, Set? options)

Creates a new DataModel object which contains the data stored within the filename file.

The options are the following ones:

  • For the CSV format:
    • ENCODING (string): specifies the encoding of the data in the file
    • SEPARATOR (string): specifies the CSV separator (comma as default)
    • QUOTE (string): specifies the character used as quote (double quote as default)
    • NAMES_ON_FIRST_LINE (boolean): consider that the first line of the file contains columns' titles (note that the TITLE_AS_FIRST_LINE option is also accepted as a synonym)
    • G_TYPE_<column number> (GType): specifies the type of value expected in column <column number>
  • Other formats: no option

Note: after the creation, please use get_errors to check any error.

Parameters:

filename

the file to import data from

random_access

TRUE if random access will be required

options

importing options

Returns:

a pointer to the newly created DataModel.




2022 vala-language.org