Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SUIT_FileValidator Class Reference

Provides functionality to check the file or directory existance and permissions. More...

#include <SUIT_FileValidator.h>

Inheritance diagram for SUIT_FileValidator:
Inheritance graph

Public Member Functions

 SUIT_FileValidator (QWidget *=0)
 Constructor. More...
 
virtual ~SUIT_FileValidator ()
 
virtual bool canOpen (const QString &, bool=true)
 Check if the specified file exists and (optionally) can be read. More...
 
virtual bool canSave (const QString &, bool=true)
 Check if the specified file can be written. More...
 
virtual bool canReadDir (const QString &, bool=true)
 Check if the specified directory exists and (optionally) can be read. More...
 
virtual bool canWriteDir (const QString &, bool=true)
 Check if the specified directory can be written. More...
 
QWidgetparent () const
 Get parent widget. More...
 

Private Attributes

QWidgetmyParent
 

Detailed Description

See Also
SUIT_FileDlg class

Constructor & Destructor Documentation

SUIT_FileValidator::SUIT_FileValidator ( QWidget parent = 0)
Parameters
parentparent widget (used as parent when displaying information message boxes)
virtual SUIT_FileValidator::~SUIT_FileValidator ( )
inlinevirtual

Member Function Documentation

bool SUIT_FileValidator::canOpen ( const QString &  fileName,
bool  checkPermission = true 
)
virtual

If file does not exists or can not be read (if checkPermission is true) and parent() is not null, shows error message box.

Parameters
fileNamefile path
checkPermissionif true (default) check also file permissions
Returns
false if file does not exist or if it does not have read permissions (if checkPermission is true)

References SUIT_MessageBox::critical(), and parent().

bool SUIT_FileValidator::canReadDir ( const QString &  dirName,
bool  checkPermission = true 
)
virtual

If directory does not exists or can not be read (if checkPermission is true) and parent() is not null, shows error message box.

Parameters
dirNamedirectory path
checkPermissionif true (default) check also directory permissions
Returns
false if directory does not exist or if it does not have read permissions (if checkPermission is true)

References SUIT_MessageBox::critical(), and parent().

bool SUIT_FileValidator::canSave ( const QString &  fileName,
bool  checkPermission = true 
)
virtual

If file already exists and parent() is not null, prompts question message box to the user to confirm file overwriting.

If file can not be written (if checkPermission is true) and parent() is not null, shows error message box.

Parameters
fileNamefile path
checkPermissionif true (default) check also file permissions
Returns
false if file exists and user rejects file overwriting or if file does not have write permissions (if checkPermission is true)

Reimplemented in LightApp_PyFileValidator.

References SUIT_MessageBox::critical(), Qtx::dir(), myParent, parent(), and SUIT_MessageBox::question().

bool SUIT_FileValidator::canWriteDir ( const QString &  dirName,
bool  checkPermission = true 
)
virtual

If directory does not exists or can not be modified (if checkPermission is true) and parent() is not null, shows error message box.

Parameters
dirNamedirectory path
checkPermissionif true (default) check also directory permissions
Returns
false if directory does not exist or if it does not have write permissions (if checkPermission is true)

References SUIT_MessageBox::critical(), and parent().

QWidget * SUIT_FileValidator::parent ( ) const
Returns
parent widget

References myParent.

Member Data Documentation

QWidget* SUIT_FileValidator::myParent
private

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