Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
FileBuilderInterface Class Reference

Interface for editing file builders. More...

#include <FileBuilderInterface.h>

Inheritance diagram for FileBuilderInterface:
ParameterizableInterface CommonInterface

Public Member Functions

 FileBuilderInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter)
 
virtual ~FileBuilderInterface ()=default
 
void addFileBuilder (int const &row, std::string const &newFileBuilderName=std::string(""))
 
void addFileBuilder (std::string const &newFileBuilderName=std::string(""))
 
virtual int getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const override final
 
std::string getCommand (std::string const &fileType) const
 
std::vector< std::string > getExpressionsInSelectedFileBuilders (std::vector< std::string > fileBuilderNames) const
 
std::string getFlags (std::string const &fileType) const
 
std::string getIndexedFileType (int const &itemIndex)
 
virtual std::vector< std::string > getItemNames () const override final
 
std::string getReplaceDefaultFlagsExpression (std::string const &fileType) const
 
std::string getReplaceDefaultFlagsFormattedExpression (std::string const &fileType) const
 
std::string getReplaceDefaultFlagsValue (std::string const &fileType, int const &baseNumber=0) const
 
virtual int itemCount () const override final
 
bool removeFileBuilder (std::string const &fileBuilderName)
 
bool setCommand (std::string const &fileType, std::string const &newCommand)
 
void setFileBuilders (QSharedPointer< QList< QSharedPointer< FileBuilder > > > newFileBuilders)
 
bool setFileType (std::string const &currentFileType, std::string const &newFileType)
 
bool setFlags (std::string const &fileType, std::string const &newFlags)
 
bool setReplaceDefaultFlags (std::string const &filetype, std::string const &newReplaceDefaultFlags)
 
virtual bool validateItems () const
 
- Public Member Functions inherited from ParameterizableInterface
 ParameterizableInterface (const ParameterizableInterface &other)=delete
 No copying. No assignment.
 
 ParameterizableInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter)
 
virtual ~ParameterizableInterface ()=default
 
ParameterizableInterfaceoperator= (const ParameterizableInterface &other)=delete
 
- Public Member Functions inherited from CommonInterface
 CommonInterface ()=default
 
 CommonInterface (const CommonInterface &other)=delete
 No copying. No assignment.
 
virtual ~CommonInterface ()=default
 
CommonInterfaceoperator= (const CommonInterface &other)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from ParameterizableInterface
QString formattedValueFor (QString const &expression) const
 
QString parseExpressionToBaseNumber (QString const &expression, unsigned int const &baseNumber, bool *expressionIsValid=nullptr) const
 
QString parseExpressionToDecimal (QString const &expression, bool *expressionIsValid=nullptr) const
 
- Protected Member Functions inherited from CommonInterface
QString getUniqueName (std::string const &newName, std::string const &itemTypeName) const
 
bool nameHasChanged (std::string const &newName, std::string const &oldName) const
 

Detailed Description

Interface for editing file builders.

Definition at line 29 of file FileBuilderInterface.h.

Constructor & Destructor Documentation

◆ FileBuilderInterface()

FileBuilderInterface::FileBuilderInterface ( QSharedPointer< ExpressionParser > expressionParser,
QSharedPointer< ExpressionFormatter > expressionFormatter )

The constructor.

Parameters
[in]expressionParserParser for expressions.
[in]expressionFormatterFormatter for expressions.

◆ ~FileBuilderInterface()

virtual FileBuilderInterface::~FileBuilderInterface ( )
virtualdefault

The destructor.

Member Function Documentation

◆ addFileBuilder() [1/2]

void FileBuilderInterface::addFileBuilder ( int const & row,
std::string const & newFileBuilderName = std::string("") )

Add a new file builder, inserting it to the position given by row.

Parameters
[in]rowRow of the new file builder.
[in]newFileBuilderNameName of the new file builder.

◆ addFileBuilder() [2/2]

void FileBuilderInterface::addFileBuilder ( std::string const & newFileBuilderName = std::string(""))

Add a new file builder. This overload should be preferred when using Python.

Parameters
[in]newFileBuilderNameName of the new file builder.

◆ getAllReferencesToIdInItem()

virtual int FileBuilderInterface::getAllReferencesToIdInItem ( const std::string & itemName,
std::string const & valueID ) const
finaloverridevirtual

Calculate all the references to the selected ID in the selected item.

Parameters
[in]itemNameName of the selected item.
[in]valueIDThe selected ID.
Returns
Number of references to the selected ID in the selected item.

Implements ParameterizableInterface.

◆ getCommand()

std::string FileBuilderInterface::getCommand ( std::string const & fileType) const

Get the command of the selected item.

Parameters
[in]fileTypeFile type of the selected item.
Returns
Command of the selected item.

◆ getExpressionsInSelectedFileBuilders()

std::vector< std::string > FileBuilderInterface::getExpressionsInSelectedFileBuilders ( std::vector< std::string > fileBuilderNames) const

Get the expressions in the selected file builders.

Parameters
[in]fileBuilderNamesNames of the selected file builders.
Returns
The expressions of the selected file builders.

◆ getFlags()

std::string FileBuilderInterface::getFlags ( std::string const & fileType) const

Get the flags of the selected item.

Parameters
[in]fileTypeFile type of the selected item.
Returns
Flags of the selected item.

◆ getIndexedFileType()

std::string FileBuilderInterface::getIndexedFileType ( int const & itemIndex)

Get the file type of the indexed file builder.

Parameters
[in]itemIndexIndex of the selected file builder.
Returns
File type of the selected file builder.

◆ getItemNames()

virtual std::vector< std::string > FileBuilderInterface::getItemNames ( ) const
finaloverridevirtual

Get the names of the available items.

Returns
Names of the available items.

Implements CommonInterface.

◆ getReplaceDefaultFlagsExpression()

std::string FileBuilderInterface::getReplaceDefaultFlagsExpression ( std::string const & fileType) const

Get the replace default flags expression of the selected item.

Parameters
[in]fileTypeThe selected file type.
Returns
Replace default flags expression of the selected file.

◆ getReplaceDefaultFlagsFormattedExpression()

std::string FileBuilderInterface::getReplaceDefaultFlagsFormattedExpression ( std::string const & fileType) const

Get the formatted replace default flags expression of the selected item.

Parameters
[in]fileTypeThe selected file type.
Returns
Formatted replace default flags expression of the selected item.

◆ getReplaceDefaultFlagsValue()

std::string FileBuilderInterface::getReplaceDefaultFlagsValue ( std::string const & fileType,
int const & baseNumber = 0 ) const

Get the calculated replace default flags value of the selected item.

Parameters
[in]fileTypeThe selected file type.
[in]baseNumberBase for displaying the value.
Returns
Calculated replace default flags value of the selected item.

◆ itemCount()

virtual int FileBuilderInterface::itemCount ( ) const
finaloverridevirtual

Get the number of available items.

Returns
Number of available items.

Implements CommonInterface.

◆ removeFileBuilder()

bool FileBuilderInterface::removeFileBuilder ( std::string const & fileBuilderName)

Remove the selected file builder.

Parameters
[in]fileBuilderNameName of the selected file builder.
Returns
True, if successful, false otherwise.

◆ setCommand()

bool FileBuilderInterface::setCommand ( std::string const & fileType,
std::string const & newCommand )

Set a new command for the selected item.

Parameters
[in]fileTypeFile type of the selected item.
[in]newCommandThe new command for the item.
Returns
True, if successful, false otherwise.

◆ setFileBuilders()

void FileBuilderInterface::setFileBuilders ( QSharedPointer< QList< QSharedPointer< FileBuilder > > > newFileBuilders)

Set available file builders.

Parameters
[in]newFileBuildersThe new file builders.

◆ setFileType()

bool FileBuilderInterface::setFileType ( std::string const & currentFileType,
std::string const & newFileType )

Set a new file type for the selected item.

Parameters
[in]currentFileTypeFile type of the selected item.
[in]newFileTypeThe new file type for the item.
Returns
True, if successful, false otherwise.

◆ setFlags()

bool FileBuilderInterface::setFlags ( std::string const & fileType,
std::string const & newFlags )

Set new flags value for the selected item.

Parameters
[in]fileTypeFile type of the selected item.
[in]newFlagsThe new flags value.
Returns
True, if successful, false otherwise.

◆ setReplaceDefaultFlags()

bool FileBuilderInterface::setReplaceDefaultFlags ( std::string const & filetype,
std::string const & newReplaceDefaultFlags )

Set a new replace default flags value for the selected item.

Parameters
[in]fileTypeThe selected file type.
[in]newReplaceDefaultFlagsNew replace default flags value.
Returns
True, if successful, false otherwise.

◆ validateItems()

virtual bool FileBuilderInterface::validateItems ( ) const
virtual

Validates the contained items.

Returns
True, if all the items are valid, false otherwise.

Implements CommonInterface.


The documentation for this class was generated from the following file: