    

 ## On this page

  

 

 # ImportCSV Class Reference

 Last update: 16.07.2025 

A class collecting import information for a csv file. [More...](class_import_c_s_v.xhtml#details)

## <a name="pub-types"></a>Public Types

typedef std::set&lt; string &gt; [delimiter\_set\_type](class_import_c_s_v.xhtml#a7ca6b7dfb092f003a8112eab3ab69523) ## <a name="pub-methods"></a>Public Member Functions

 [check](class_import_c_s_v.xhtml#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) Checks validity of these data. [More...](#a47c34ec1e578c2ce27cf1c5fcd0d1704)  
  [import](class_import_c_s_v.xhtml#a73dd3f56399568385400db0c3fc08295) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) Imports the file with given name filename into the database given. [More...](#a73dd3f56399568385400db0c3fc08295)  
  [ImportCSV](class_import_c_s_v.xhtml#a60886859ba515644d1501c975b1af532) (string [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2)) throw () Tries to determine some defaults to parse the CSV file [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2 "The CSV file name to be parsed and imported. ") given into the database. [More...](#a60886859ba515644d1501c975b1af532)  
 ## <a name="pub-attribs"></a>Public Attributes

<a id="a0b2e98e6d6483b285675f9e0128ad223"></a>string [delimiter](class_import_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223) The delimiter character to be used to parse the CSV file See csv::CSVReader::m\_delimiter for more information.   
 <a id="a05bc029610051c80b0f364bfc6587340"></a>bool [enforce\_integer\_design\_idents](class_import_c_s_v.xhtml#a05bc029610051c80b0f364bfc6587340) true if the design idents to be parsed are to be numbers (else: arbitrary strings)   
 <a id="a3a1a90139c2c8ab1fca0ea8b1790b7b2"></a>string [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2) The CSV file name to be parsed and imported.   
 bool [row\_orientated](class_import_c_s_v.xhtml#ae3708cb2d385c0e5dccbad90b0dd1069) Indicates the orientation of the CSV file given. [More...](#ae3708cb2d385c0e5dccbad90b0dd1069)  
 <a id="details" name="details"></a>## Detailed Description

A class collecting import information for a csv file.



## Member Typedef Documentation

<a id="a7ca6b7dfb092f003a8112eab3ab69523"></a>## [◆ ](#a7ca6b7dfb092f003a8112eab3ab69523)delimiter\_set\_type

 typedef std::set&lt; string &gt; [delimiter\_set\_type](class_import_c_s_v.xhtml#a7ca6b7dfb092f003a8112eab3ab69523)





## Constructor &amp; Destructor Documentation

<a id="a60886859ba515644d1501c975b1af532"></a>## [◆ ](#a60886859ba515644d1501c975b1af532)ImportCSV()

 [ImportCSV](class_import_c_s_v.xhtml)  ( string  *filename*)  throw ( )

Tries to determine some defaults to parse the CSV file [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2 "The CSV file name to be parsed and imported. ") given into the database.

Sets the member variable [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2 "The CSV file name to be parsed and imported. ") and parses the CSV file to set useful defaults to the member variables [delimiter](class_import_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223 "The delimiter character to be used to parse the CSV file See csv::CSVReader::m_delimiter for more inf..."), #m\_has\_header\_line and #m\_suggested\_delimiters.

Parameters filenameThe input file name 



## Member Function Documentation

<a id="a47c34ec1e578c2ce27cf1c5fcd0d1704"></a>## [◆ ](#a47c34ec1e578c2ce27cf1c5fcd0d1704)check()

 check  ( [Structure](class_structure.xhtml)  *database*) 

Checks validity of these data.

Parameters databaseThe database where the data is going to be imported to Exceptions std::exceptionIf the specified file does not exist std::exception If no header line can be found using the [filename](class_import_c_s_v.xhtml#a3a1a90139c2c8ab1fca0ea8b1790b7b2 "The CSV file name to be parsed and imported. ") and [delimiter](class_import_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223 "The delimiter character to be used to parse the CSV file See csv::CSVReader::m_delimiter for more inf...") member variables as input for SoS\_CSV\_reader\_type::testHeaderLine() 



<a id="a73dd3f56399568385400db0c3fc08295"></a>## [◆ ](#a73dd3f56399568385400db0c3fc08295)import()

 import  ( [Structure](class_structure.xhtml)  *database*) 

Imports the file with given name filename into the database given.

Parameters databaseThe data base where all data is to be added.Exceptions std::exceptionIf an equally named data object would be replaced 



## Member Data Documentation

<a id="ae3708cb2d385c0e5dccbad90b0dd1069"></a>## [◆ ](#ae3708cb2d385c0e5dccbad90b0dd1069)row\_orientated

 bool row\_orientated

Indicates the orientation of the CSV file given.

True means a row orientated format, false indicates a column orientated format.