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: <itemizedlist> <listitem><para>For the CSV format: <itemizedlist> < listitem><para>ENCODING (string): specifies the encoding of the data in the file</para></listitem> <listitem> <para>SEPARATOR (string): specifies the CSV separator (comma as default)</para></listitem> <listitem><para> QUOTE (string): specifies the character used as quote (double quote as default)</para></listitem> <listitem><para >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)</para></listitem> <listitem><para>G_TYPE_&lt;column number&gt; ( GType): specifies the type of value expected in column &lt;column number&gt;</para></listitem> </itemizedlist> </para></listitem> <listitem><para>Other formats: no option</para></listitem> </itemizedlist>

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