libgdamm: Gnome::Gda::DataModelImport Class Reference

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions

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

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

Inheritance diagram for Gnome::Gda::DataModelImport:
[legend]
Collaboration diagram for Gnome::Gda::DataModelImport:
[legend]

List of all members.

## Public Member Functions
virtual | ~DataModelImport ()
GdaDataModelImport* | gobj ()
| Provides access to the underlying C GObject.
const GdaDataModelImport* | gobj () const
| 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.
GSList* | get_errors ()
| Get the list of errors which model has to report.
void | clean_errors ()
| Clears the history of errors model has to report.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_data_string () const
| String to import.
Glib::PropertyProxy_ReadOnly < std::string > | property_filename () const
| File to import.
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Set > > | property_options () const
| Options to configure the import.
Glib::PropertyProxy_ReadOnly < bool > | property_random_access () const
| Random access to the data model is possible.
Glib::PropertyProxy_ReadOnly < xmlNodePtr > | property_xml_node () const
| XML node to import from.
## Static Public Member Functions
static Glib::RefPtr < DataModelImport > | create (const std::string& filename, bool random_access, const Glib::RefPtr< const Set >& options)
static Glib::RefPtr < DataModelImport > | create (const gchar* data, bool random_access, const Glib::RefPtr< const Set >& options)
static Glib::RefPtr < DataModelImport > | create (xmlNodePtr node)
## Protected Member Functions
| DataModelImport (const std::string& filename, bool random_access, const Glib::RefPtr< const Set >& options)
| DataModelImport (const gchar* data, bool random_access, const Glib::RefPtr< const Set >& options)
| DataModelImport (xmlNodePtr node)
## 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 Set 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 Set >& | options
| ) |  | `[protected]`

Gnome::Gda::DataModelImport::DataModelImport | ( | const gchar * | data,
|  | bool | random_access,
|  | const Glib::RefPtr< const Set >& | 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 | ( | const std::string & | filename,
|  | bool | random_access,
|  | const Glib::RefPtr< const Set >& | options
| ) |  | `[static]`

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

static Glib::RefPtr<DataModelImport> Gnome::Gda::DataModelImport::create | ( | xmlNodePtr | node ) | `[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::DataModel.

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

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::DataModel.

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.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::DataModelImport::property_data_string | ( | ) | const

String to import.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<std::string> Gnome::Gda::DataModelImport::property_filename | ( | ) | const

File to import.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Set> > Gnome::Gda::DataModelImport::property_options | ( | ) | const

Options to configure the import.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gnome::Gda::DataModelImport::property_random_access | ( | ) | const

Random access to the data model is possible.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<xmlNodePtr> Gnome::Gda::DataModelImport::property_xml_node | ( | ) | const

XML node to import from.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

## 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:

- libgdamm/datamodelimport.h