hk_importcsv Class Reference

imports comma delimited textfiles More...

#include <hk_importcsv.h>

Inheritance diagram for hk_importcsv:

Inheritance graph
[legend]
Collaboration diagram for hk_importcsv:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool execute (enum_interaction i=interactive)
void set_filedefinition (const hk_string &textdelimiter="\"", const hk_string &betweenfields=",", const hk_string &rowdelimiter="\n", const hk_string &datetimeformat="", const hk_string &dateformat="", const hk_string &timeformat="", const hk_string &charset="", const hk_string &locale="")
void set_filename (const hk_string &filename)
void set_firstrow_contains_fieldnames (bool f=true)
void set_append_rows (bool f=false)
void set_create_new_table (bool n=true)
void add_columnname (const hk_string &col)
void clear_columnlist (void)
void set_detect_autoinc (bool)
bool detect_autoinc (void) const
hk_string textdelimiter (void)
hk_string betweenfield (void)
hk_string rowdelimiter (void)
hk_string datetimeformat (void)
hk_string dateformat (void)
hk_string timeformat (void)
hk_string filelocale (void)
hk_string filecharset (void)
void set_overwrite_table (bool)
bool overwrite_table (void)
vector< hk_string > * create_valuelist (hk_string &row)
void get_line (ifstream &, hk_string &)

Protected Member Functions

void set_progressdialog (progress_dialogtype *progressdialog)
progress_dialogtype * progressdialog (void) const
void set_columns (void)
void create_automatic_columns (void)
bool initialize_table (enum_interaction)
virtual bool before_columns_deleted (void)
virtual bool widget_specific_after_new_row (void)

Detailed Description

imports comma delimited textfiles

Version:
Revision
1.27
Author:
Horst Knorr (hk_classes@knoda.org)


Member Function Documentation

bool hk_importcsv::execute ( enum_interaction  i = interactive  ) 

after setting all infos start the import with execut

Returns:
true if successful else false

void hk_importcsv::set_filedefinition ( const hk_string &  textdelimiter = "\"",
const hk_string &  betweenfields = ",",
const hk_string &  rowdelimiter = "\n",
const hk_string &  datetimeformat = "",
const hk_string &  dateformat = "",
const hk_string &  timeformat = "",
const hk_string &  charset = "",
const hk_string &  locale = "" 
)

defines the fielddelimiter and the columndelimiter of the csv-file.

void hk_importcsv::set_filename ( const hk_string &  filename  ) 

Name of the CSV-file

void hk_importcsv::set_firstrow_contains_fieldnames ( bool  f = true  ) 

If the first row in the CSV file contains set this function to true else false Default is true

void hk_importcsv::set_append_rows ( bool  f = false  ) 

If user wants to append data, instead of creating a new table or overwriting an existing table. Default is false.

void hk_importcsv::set_create_new_table ( bool  n = true  ) 

If set to true a new table will be created else it will be appended to an existing table

void hk_importcsv::add_columnname ( const hk_string &  col  ) 

Define the equivalent column names in an existing table. Column 1 of the CSV File will be added to the first column of the table.

vector< hk_string > * hk_importcsv::create_valuelist ( hk_string &  row  ) 

the parser is based on the KOffice/Kspread import filter 1999 David Faure

bool hk_importcsv::before_columns_deleted ( void   )  [protected, virtual]

FOR WIDGET DEVELOPERS ONLY: will be automatically called before the columns will be deleted. usually column pointers will be set to NULL in this function. i.e.when enabling,disabling or when a depending datasource has to requery its rows.

Reimplemented from hk_dsvisible.

bool hk_importcsv::widget_specific_after_new_row ( void   )  [protected, virtual]

If this function returns false the execution of the import will be cancelled


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 02:48:33 2006 for Databaseconnectionclasses by  doxygen 1.5.0