Web Analytics Made Easy - Statcounter
Skip to content

Class SBIFileImporter#

ClassList > SBIFileImporter

This class is the base class for importers. More...

  • #include <SBIFileImporter.hpp>

Public Functions#

Type Name
virtual bool canImportFromFile (const std::string & fileName)
Returns true when the filefileName can be imported using this importer.
virtual std::string getExtension () const
Returns the extension, e.g. "pdb".
virtual std::string getFilter () const
Returns the filter, e.g. "Protein Data Bank (*.pdb)" (Qt format)
SBGFileImporter * getPropertyDialog () const
Returns the property dialog of the importer.
virtual bool importFromFile (const std::string & fileName, const SBValueMap & parameterMap=SBValueMap{}, SBDDocumentFolder * preferredFolder=nullptr) = 0
Imports data from a file fileName into the folderpreferredFolder with the givenparameters .
void setPropertyDialog (SBGFileImporter * g)
Sets the property dialog of the importer.
virtual ~SBIFileImporter ()
Destroys the SBIFileImporter .

Protected Attributes#

Type Name
SBGFileImporter * propertyDialog

Protected Functions#

Type Name
SBIFileImporter ()
Constructs an SBIFileImporter .

Detailed Description#

Short name: SBImporter

Public Functions Documentation#

function canImportFromFile#

Returns true when the filefileName can be imported using this importer.

virtual bool SBIFileImporter::canImportFromFile (
    const std::string & fileName
) 

Determines whether this importer can import data from the specified file.

This function is called before trying to import a file and is particularly useful if there are multiple importers each supporting different subsets of the format. If your importer supports only a subset of the format then you can check in this function whether the file corresponds to this format and return the result.

By default it returns true and doesn't check for the file's extension.

Parameters:

  • fileName The name of the file to check.

Returns:

true if the file can be imported; otherwise false.


function getExtension#

Returns the extension, e.g. "pdb".

virtual std::string SBIFileImporter::getExtension () const

Returns the default file extension for this importer.

Returns:

The file extension (e.g., "pdb").


function getFilter#

Returns the filter, e.g. "Protein Data Bank (*.pdb)" (Qt format)

virtual std::string SBIFileImporter::getFilter () const

Returns the file filter string for this importer.

Returns:

The filter string (e.g., "Protein Data Bank (*.pdb)").


function getPropertyDialog#

Returns the property dialog of the importer.

SBGFileImporter * SBIFileImporter::getPropertyDialog () const

Returns the property dialog associated with this importer.

Returns:

Pointer to the SBGFileImporter representing the property dialog; may be nullptr if none is set.


function importFromFile#

Imports data from a file fileName into the folderpreferredFolder with the givenparameters .

virtual bool SBIFileImporter::importFromFile (
    const std::string & fileName,
    const SBValueMap & parameterMap=SBValueMap {},
    SBDDocumentFolder * preferredFolder=nullptr
) = 0


function setPropertyDialog#

Sets the property dialog of the importer.

void SBIFileImporter::setPropertyDialog (
    SBGFileImporter * g
) 

Sets the property dialog for this importer.

Parameters:

  • g Pointer to the property dialog to associate with this importer.

function ~SBIFileImporter#

Destroys the SBIFileImporter .

virtual SBIFileImporter::~SBIFileImporter () 


Protected Attributes Documentation#

variable propertyDialog#

SBGFileImporter* SBIFileImporter::propertyDialog;

Protected Functions Documentation#

function SBIFileImporter#

Constructs an SBIFileImporter .

SBIFileImporter::SBIFileImporter ()