![]() |
Kactus2
Kactus2 reference guide
|
Interface for editing files. More...
#include <FileInterface.h>
Public Member Functions | |
FileInterface (QSharedPointer< FileValidator > validator, QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter) | |
virtual | ~FileInterface ()=default |
bool | addDependency (std::string const &fileName, std::string const newDependency) |
bool | addExportedName (std::string const &fileName, std::string const newExportedName) |
void | addFile (int const &row, std::string const &newFileName=std::string("")) |
void | addFile (std::string const &newFileName=std::string("")) |
bool | addFileType (std::string const &fileName, std::string const newFileType) |
bool | addImageType (std::string const &fileName, std::string const newImageType) |
bool | addMultipleDependencies (std::string const &fileName, std::vector< std::string > const newDependencies) |
bool | addMultipleExportedNames (std::string const &fileName, std::vector< std::string > const newExportedNames) |
bool | addMultipleFileTypes (std::string const &fileName, std::vector< std::string > const newFileTypes) |
bool | addMultipleImageTypes (std::string const &fileName, std::vector< std::string > const newImageTypes) |
void | clearDependencies (std::string const &fileName) |
void | clearExportedNames (std::string const &fileName) |
void | clearFileTypes (std::string const &fileName) |
void | clearImageTypes (std::string const &fileName) |
virtual int | getAllReferencesToIdInItem (const std::string &fileName, std::string const &valueID) const override final |
std::string | getBuildCommandFlags (std::string const &fileName) const |
std::string | getBuildCommandReplaceDefaultFlagsExpression (std::string const &fileName) const |
std::string | getBuildCommandReplaceDefaultFlagsFormattedExpression (std::string const &fileName) const |
std::string | getBuildCommandReplaceDefaultFlagsValue (std::string const &fileName, int const &baseNumber=0) const |
std::string | getBuildCommandTarget (std::string const &fileName) const |
std::string | getBuildCommandText (std::string const &fileName) const |
std::vector< std::string > | getDependencies (std::string const &fileName) const |
std::string | getDescription (std::string const &itemName) const override |
std::vector< std::string > | getExportedNames (std::string const &fileName) const |
std::vector< std::string > | getExpressionsInSelectedFiles (std::vector< std::string > fileNames) const |
std::vector< std::string > | getFileTypes (std::string const &fileName) const |
std::vector< std::string > | getImageTypes (std::string const &fileName) const |
std::string | getIndexedItemName (int itemIndex) const final |
virtual int | getItemIndex (std::string const &itemName) const override final |
virtual std::vector< std::string > | getItemNames () const override final |
std::string | getLogicalName (std::string const &fileName) const |
bool | hasExternalDeclarations (std::string const &fileName) const |
bool | isIncludeFile (std::string const &fileName) const |
bool | isLogicalNameDefault (std::string const &fileName) const |
bool | isStructural (std::string const &fileName) const |
virtual int | itemCount () const override final |
virtual bool | itemHasValidName (std::string const &itemName) const override final |
bool | removeFile (std::string const &fileName) |
bool | setBuildCommand (std::string const &fileName, std::string const &newBuildCommand) |
bool | setBuildCommandFlags (std::string const &fileName, std::string const &newFlags) |
bool | setbuildCommandReplaceDefaultFlags (std::string const &fileName, std::string const &newReplaceDefaultFlags) |
bool | setBuildCommandTarget (std::string const &fileName, std::string const &newTarget) |
bool | setDescription (std::string const &itemName, std::string const &newDescription) override |
bool | setExternalDeclarations (std::string const &fileName, bool externalDeclarationsStatus) |
void | setFiles (QSharedPointer< QList< QSharedPointer< File > > > newFiles) |
bool | setFileTypes (std::string const &fileName, std::vector< std::string > const newFileTypes) |
bool | setIncludeFile (std::string const &fileName, bool includeFileStatus) |
bool | setLogicalName (std::string const &fileName, std::string newLogicalName) |
bool | setLogicalNameDefault (std::string const &fileName, bool newLogicalDefault) |
virtual bool | setName (std::string const ¤tName, std::string const &newName) override final |
bool | setStructural (std::string const &fileName, bool structuralStatus) |
void | swapFiles (int const &firstIndex, int const &secondIndex) |
virtual bool | validateItems () const override final |
![]() | |
ParameterizableInterface (const ParameterizableInterface &other)=delete | |
No copying. No assignment. | |
ParameterizableInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter) | |
virtual | ~ParameterizableInterface ()=default |
ParameterizableInterface & | operator= (const ParameterizableInterface &other)=delete |
![]() | |
NameGroupInterface () | |
NameGroupInterface (const NameGroupInterface &other)=delete | |
No copying. No assignment. | |
virtual | ~NameGroupInterface ()=default |
virtual std::string | getDisplayName (std::string const &itemName) const |
virtual std::string | getShortDescription (std::string const &itemName) const |
NameGroupInterface & | operator= (const NameGroupInterface &other)=delete |
virtual bool | setDisplayName (std::string const &itemName, std::string const &newDisplayName) const |
bool | setShortDescription (std::string const &itemName, std::string const &newShortDescription) const |
![]() | |
CommonInterface ()=default | |
CommonInterface (const CommonInterface &other)=delete | |
No copying. No assignment. | |
virtual | ~CommonInterface ()=default |
CommonInterface & | operator= (const CommonInterface &other)=delete |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
QString | getUniqueName (std::string const &newName, std::string const &itemTypeName) const |
bool | nameHasChanged (std::string const &newName, std::string const &oldName) const |
Interface for editing files.
Definition at line 32 of file FileInterface.h.
FileInterface::FileInterface | ( | QSharedPointer< FileValidator > | validator, |
QSharedPointer< ExpressionParser > | expressionParser, | ||
QSharedPointer< ExpressionFormatter > | expressionFormatter ) |
The constructor.
[in] | validator | Validator for files. |
[in] | expressionParser | Parser for expressions. |
[in] | expressionFormatter | Formatter for expressions. |
|
virtualdefault |
The destructor.
bool FileInterface::addDependency | ( | std::string const & | fileName, |
std::string const | newDependency ) |
Add the selected dependency to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newDependency | The new dependency. |
bool FileInterface::addExportedName | ( | std::string const & | fileName, |
std::string const | newExportedName ) |
Add the selected exported name to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newExportedName | The new exported name. |
void FileInterface::addFile | ( | int const & | row, |
std::string const & | newFileName = std::string("") ) |
Add a new file, inserting it to a specified position given by row.
[in] | row | Row of the new file. |
[in] | newFileName | Name of the new file. |
void FileInterface::addFile | ( | std::string const & | newFileName = std::string("") | ) |
Add a new file. This overload should be preferred when using Python.
[in] | newFileName | Name of the new file. |
bool FileInterface::addFileType | ( | std::string const & | fileName, |
std::string const | newFileType ) |
Add the selected file type to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newFileType | The new file type. |
bool FileInterface::addImageType | ( | std::string const & | fileName, |
std::string const | newImageType ) |
Add the selected image type to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newImageType | The new image type. |
bool FileInterface::addMultipleDependencies | ( | std::string const & | fileName, |
std::vector< std::string > const | newDependencies ) |
Add multiple dependencies to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newDependencies | The new dependencies. |
bool FileInterface::addMultipleExportedNames | ( | std::string const & | fileName, |
std::vector< std::string > const | newExportedNames ) |
Add multiple exported names to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newExportedNames | The new exported names. |
bool FileInterface::addMultipleFileTypes | ( | std::string const & | fileName, |
std::vector< std::string > const | newFileTypes ) |
Add multiple file type to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newFileTypes | The new file types. |
bool FileInterface::addMultipleImageTypes | ( | std::string const & | fileName, |
std::vector< std::string > const | newImageTypes ) |
Add multiple image types to the selected file.
[in] | fileName | Name of the selected file. |
[in] | newImageTypes | The new image types. |
void FileInterface::clearDependencies | ( | std::string const & | fileName | ) |
Clear all the dependencies on the selected file.
[in] | fileName | Name of the selected file. |
void FileInterface::clearExportedNames | ( | std::string const & | fileName | ) |
Clear all the exported names of the selected file.
[in] | fileName | Name of the selected file. |
void FileInterface::clearFileTypes | ( | std::string const & | fileName | ) |
Clear all the fileTypes and userFileTypes.
[in] | fileName | Name of the selected file. |
void FileInterface::clearImageTypes | ( | std::string const & | fileName | ) |
Clear all the image types on the selected file.
[in] | fileName | Name of the selected file. |
|
finaloverridevirtual |
Calculate all the references to the selected ID in the selected file.
[in] | fileName | Name of the selected item. |
[in] | valueID | The selected ID. |
Implements ParameterizableInterface.
std::string FileInterface::getBuildCommandFlags | ( | std::string const & | fileName | ) | const |
Get the build command flags of selected file.
[in] | fileName | Name of the selected file. |
std::string FileInterface::getBuildCommandReplaceDefaultFlagsExpression | ( | std::string const & | fileName | ) | const |
Get the build command replace default flags expression of the selected file.
[in] | fileName | Name of the selected file. |
std::string FileInterface::getBuildCommandReplaceDefaultFlagsFormattedExpression | ( | std::string const & | fileName | ) | const |
Get the formatted build command replace default flags expression of the selected file.
[in] | fileName | Name of the selected file. |
std::string FileInterface::getBuildCommandReplaceDefaultFlagsValue | ( | std::string const & | fileName, |
int const & | baseNumber = 0 ) const |
Get the calculated build command replace default flags value of the selected file.
[in] | fileName | Name of the selected file. |
[in] | baseNumber | Base for displaying the value. |
std::string FileInterface::getBuildCommandTarget | ( | std::string const & | fileName | ) | const |
Get the build command target of selected file.
[in] | fileName | Name of the selected file. |
std::string FileInterface::getBuildCommandText | ( | std::string const & | fileName | ) | const |
Get the build command of selected file.
[in] | fileName | Name of the selected file. |
std::vector< std::string > FileInterface::getDependencies | ( | std::string const & | fileName | ) | const |
Get the dependencies of a file.
[in] | fileName | Name of the selected file. |
|
overridevirtual |
Get the description of the selected item. Can't inherit this function from NameGroupInterface, as File doesn't inherit from NameGroup.
[in] | itemName | Name of the selected item. |
Reimplemented from NameGroupInterface.
std::vector< std::string > FileInterface::getExportedNames | ( | std::string const & | fileName | ) | const |
Get the exported names of a file.
[in] | fileName | Name of the selected file. |
std::vector< std::string > FileInterface::getExpressionsInSelectedFiles | ( | std::vector< std::string > | fileNames | ) | const |
Get the expressions in the selected files.
[in] | fileNames | Names of the selected files. |
std::vector< std::string > FileInterface::getFileTypes | ( | std::string const & | fileName | ) | const |
Get the file types of the selected file.
[in] | fileName | Name of the selected file. |
std::vector< std::string > FileInterface::getImageTypes | ( | std::string const & | fileName | ) | const |
Get the image types of a file.
[in] | fileName | Name of the selected file. |
|
finalvirtual |
Get name of the indexed item.
[in] | itemIndex | Index of the selected item. |
Implements NameGroupInterface.
|
finaloverridevirtual |
Get index of the selected item.
[in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
|
finaloverridevirtual |
Get the names of the available items.
Implements CommonInterface.
std::string FileInterface::getLogicalName | ( | std::string const & | fileName | ) | const |
Get the logical name of a file.
[in] | fileName | Name of the selected file. |
bool FileInterface::hasExternalDeclarations | ( | std::string const & | fileName | ) | const |
Get attribute value of external declarations.
[in] | fileName | Name of the selected file. |
bool FileInterface::isIncludeFile | ( | std::string const & | fileName | ) | const |
Get the isIncludeFile setting.
[in] | fileName | Name of the selected file. |
bool FileInterface::isLogicalNameDefault | ( | std::string const & | fileName | ) | const |
Get the default-attribute value of the logicalName element.
[in] | fileName | Name of the selected file. |
bool FileInterface::isStructural | ( | std::string const & | fileName | ) | const |
Check if the file contains a structural RTL or not.
[in] | fileName | Name of the selected file. |
|
finaloverridevirtual |
|
finaloverridevirtual |
Check if the selected item has a valid name.
[in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
bool FileInterface::removeFile | ( | std::string const & | fileName | ) |
Remove the selected file.
[in] | fileName | Name of the selected file. |
bool FileInterface::setBuildCommand | ( | std::string const & | fileName, |
std::string const & | newBuildCommand ) |
Set the build command for the selected file.
[in] | fileName | Name of the selected file. |
[in] | newBuildCommand | The new build command. |
bool FileInterface::setBuildCommandFlags | ( | std::string const & | fileName, |
std::string const & | newFlags ) |
Set the build flags for the selected file.
[in] | fileName | Name of the selected file. |
[in] | newFlags | The new flags. |
bool FileInterface::setbuildCommandReplaceDefaultFlags | ( | std::string const & | fileName, |
std::string const & | newReplaceDefaultFlags ) |
Set a new build command replace default flags value for the selected file.
[in] | fileName | Name of the selected file. |
[in] | newReplaceDefaultFlags | New build command replace default flags value. |
bool FileInterface::setBuildCommandTarget | ( | std::string const & | fileName, |
std::string const & | newTarget ) |
Set the build target for the selected file.
[in] | fileName | Name of the selected file. |
[in] | newTarget | The new target. |
|
overridevirtual |
Set a new description for the selected item. Can't inherit this function from NameGroupInterface, as File doesn't inherit from NameGroup.
[in] | itemName | Name of the selected item. |
[in] | newDescription | New description. |
Reimplemented from NameGroupInterface.
bool FileInterface::setExternalDeclarations | ( | std::string const & | fileName, |
bool | externalDeclarationsStatus ) |
Set the externalDeclarations setting
[in] | fileName | Name of the selected file. |
[in] | externalDeclarationsStatus | Boolean value to be set. |
void FileInterface::setFiles | ( | QSharedPointer< QList< QSharedPointer< File > > > | newFiles | ) |
Set available files.
[in] | newFiles | The new files. |
bool FileInterface::setFileTypes | ( | std::string const & | fileName, |
std::vector< std::string > const | newFileTypes ) |
Set file types for the selected file.
[in] | fileName | Name of the selected file. |
[in] | newFileTypes | The new file types. |
bool FileInterface::setIncludeFile | ( | std::string const & | fileName, |
bool | includeFileStatus ) |
Set the isIncludeFile setting for this file.
[in] | fileName | Name of the selected file. |
[in] | includeFileStatus | Boolean value to be set. |
bool FileInterface::setLogicalName | ( | std::string const & | fileName, |
std::string | newLogicalName ) |
Set a new logical name.
[in] | fileName | Name of the selected file. |
[in] | newLogicalName | The new logical name. |
bool FileInterface::setLogicalNameDefault | ( | std::string const & | fileName, |
bool | newLogicalDefault ) |
Set the logical name attribute default.
[in] | fileName | Name of the selected file. |
[in] | newLogicalDefault | Boolean value of the attribute. |
|
finaloverridevirtual |
Set a new name for the selected item.
[in] | currentName | Name of the selected item. |
[in] | newName | New name for the item. |
Implements NameGroupInterface.
bool FileInterface::setStructural | ( | std::string const & | fileName, |
bool | structuralStatus ) |
Set the file to contain structural RTL.
[in] | fileName | Name of the selected file. |
[in] | structuralStatus | The new structural status. |
void FileInterface::swapFiles | ( | int const & | firstIndex, |
int const & | secondIndex ) |
Swap the positions of the selected files.
[in] | firstIndex | Index of the first file. |
[in] | secondIndex | Index of the second file. |
|
finaloverridevirtual |
Validates the contained items.
Implements CommonInterface.