libgdamm Reference Documentation

Main Page Namespaces Book

# Gnome::Gda::DataModelImport Class Reference
[Data Models]

Importing data from a string or a file. More...

Inheritance diagram for Gnome::Gda::DataModelImport:

[legend]
List of all members.

## Public Member Functions

void | clean_errors ()
| Clears the history of errors model has to report.
GSList* | get_errors ()
| Get the list of errors which model has to report.
const GdaDataModelImport* | gobj () const
| Provides access to the underlying C GObject.
GdaDataModelImport* | gobj ()
| Provides access to the underlying C GObject.
GdaDataModelImport* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
virtual | ~DataModelImport ()

## Static Public Member Functions

static Glib::RefPtr<DataModelImport> | create (xmlNodePtr node)
static Glib::RefPtr<DataModelImport> | create (const gchar* data, bool random_access, const Glib::RefPtr<const ParameterList>& options)
static Glib::RefPtr<DataModelImport> | create (const std::string& filename, bool random_access, const Glib::RefPtr<const ParameterList>& options)

## Protected Member Functions

| DataModelImport (xmlNodePtr node)
| DataModelImport (const gchar* data, bool random_access, const Glib::RefPtr<const ParameterList>& options)
| DataModelImport (const std::string& filename, bool random_access, const Glib::RefPtr<const ParameterList>& options)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gnome::Gda::DataModelImport> | wrap (GdaDataModelImport* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Importing data from a string or a file.

This data model imports data from a string or a file. The data can either be in a CSV (comma separated values) format or in an XML format as described by the libgda-array.dtd DTD (It is also possible to import data from an already-build XML tree validated against that DTD). The caller must decide, upon construction, if the new DataModelImport must support random access or simply cursor based access. Random access makes it easier to use the resulting data model but consumes more memory as all the data is copied in memory, and this is thus not suitable for large data sets. Note that importing from an already-built XML tree will always result in a random access data model.

Various import options can be specified using parameters in a ParameterList object. The available options depend on the format of the imported data listed here:

- "SEPARATOR" (string, CVS import only): specifies the separator to consider.
- "ESCAPE_CHAR" (string, CVS import only): specifies the character used to "escape" the strings contained between two separators.
- "ENCODING" (string, CVS import only): specifies the character set used in the imported data.
- "TITLE_AS_FIRST_LINE" (boolean, CVS import only): TRUE to specify that the first line of the imported data contains the column names.
- "GDA_TYPE_<col number>" (gda type, CVS import only): specifies the requested GDA type for the column numbered "col number".
- "DBMS_TYPE_<col number>" (string, CVS import only): specifies the requested DBMS type for the column numbered "col number"; if the DBMS type is listed in the dictionary used by the created model, then the GDA type is set in accordance.

## Constructor & Destructor Documentation

virtual Gnome::Gda::DataModelImport::~DataModelImport | ( |  | ) | `[virtual]`

Gnome::Gda::DataModelImport::DataModelImport | ( | const std::string & | filename,
|  | bool | random_access,
|  | const Glib::RefPtr<const ParameterList>& | options |
| ) |  |  | `[protected]`

Gnome::Gda::DataModelImport::DataModelImport | ( | const gchar * | data,
|  | bool | random_access,
|  | const Glib::RefPtr<const ParameterList>& | options |
| ) |  |  | `[protected]`

Gnome::Gda::DataModelImport::DataModelImport | ( | xmlNodePtr | node | ) | `[explicit, protected]`

## Member Function Documentation

void Gnome::Gda::DataModelImport::clean_errors | ( |  | ) |

Clears the history of errors model has to report.

static Glib::RefPtr<DataModelImport> Gnome::Gda::DataModelImport::create | ( | xmlNodePtr | node | ) | `[static]`

static Glib::RefPtr<DataModelImport> Gnome::Gda::DataModelImport::create | ( | const gchar * | data,
|  | bool | random_access,
|  | const Glib::RefPtr<const ParameterList>& | options |
| ) |  |  | `[static]`

static Glib::RefPtr<DataModelImport> Gnome::Gda::DataModelImport::create | ( | const std::string & | filename,
|  | bool | random_access,
|  | const Glib::RefPtr<const ParameterList>& | options |
| ) |  |  | `[static]`

GSList* Gnome::Gda::DataModelImport::get_errors | ( |  | ) |

Get the list of errors which model has to report.

The returned list is a list of Error structures, and must not be modified

Returns:
  The list of errors (which must not be modified), or `0`.

const GdaDataModelImport* Gnome::Gda::DataModelImport::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::DataModelRow.

GdaDataModelImport* Gnome::Gda::DataModelImport::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::DataModelRow.

GdaDataModelImport* Gnome::Gda::DataModelImport::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gnome::Gda::DataModelRow.

## Friends And Related Function Documentation

Glib::RefPtr<Gnome::Gda::DataModelImport> wrap | ( | GdaDataModelImport * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- datamodelimport.h