ImFusion SDK 4.3
CSVParser Class Reference

#include <ImFusion/GUI/CSVParseDialog.h>

Converts a CSV file into a Table, with customizable delimiters and optional headers. More...

+ Inheritance diagram for CSVParser:

Detailed Description

Converts a CSV file into a Table, with customizable delimiters and optional headers.

User should call parse when the delimiters and headers options are set as desired. Optionally a Progress object can be passed in to monitor the progress of the parsing, as well as limit the number of rows to parse.

Public Member Functions

 CSVParser (const std::string &filename="")
 Constructs a CSV parser. Optionally specify the filename of the CSV file to parse.
 
void setFilename (const std::string &filename)
 Sets or updates the filename to parse.
 
void setDelimiters (const std::vector< char > &delimiters)
 Sets which delimiters to use for parsing the CSV file.
 
std::vector< char > delimiters ()
 Returns the delimiters currently in use.
 
void setContainsHeaders (bool headers)
 Sets if the CSV file contains a first row of headers and should be used as headers in the table.
 
bool containsHeaders ()
 Sets if the headers should be included as a row in the table.
 
void parse (Progress *progress=nullptr, int maxRows=-1)
 Updates the internal table using the current set of delimiters and header options Optional progress and maximum number of rows to process.
 
Tabletable ()
 Returns the extracted table from the CSV.
 
void clearTable ()
 Clears the table, call parse again to refill it.
 
std::string filename ()
 
virtual void configure (const Properties *) override
 Configure this object instance by de-serializing the given Properties.
 
virtual void configuration (Properties *) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ configure()

virtual void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

virtual void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from Configurable.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close