Provides functionality to check the file or directory existance and permissions. More...
#include <SUIT_FileValidator.h>

Public Member Functions | |
| SUIT_FileValidator (QWidget *=0) | |
| Constructor. | |
| virtual bool | canOpen (const QString &, bool=true) |
| Check if the specified file exists and (optionally) can be read. | |
| virtual bool | canSave (const QString &, bool=true) |
| Check if the specified file can be written. | |
| virtual bool | canReadDir (const QString &, bool=true) |
| Check if the specified directory exists and (optionally) can be read. | |
| virtual bool | canWriteDir (const QString &, bool=true) |
| Check if the specified directory can be written. | |
| QWidget * | parent () const |
| Get parent widget. | |
Private Attributes | |
| QWidget * | myParent |
| SUIT_FileValidator::SUIT_FileValidator | ( | QWidget * | parent = 0 | ) |
| parent | parent widget (used as parent when displaying information message boxes) |
| 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.
| fileName | file path |
| checkPermission | if true (default) check also file permissions |
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::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.
| fileName | file path |
| checkPermission | if true (default) check also file permissions |
false if file exists and user rejects file overwriting or if file does not have write permissions (if checkPermission is true) Reimplemented in DumpCommandsFileValidator, and DumpStudyFileValidator.
References SUIT_MessageBox.critical(), Qtx.dir(), myParent, parent(), and SUIT_MessageBox.question().
| 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.
| dirName | directory path |
| checkPermission | if true (default) check also directory permissions |
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::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.
| dirName | directory path |
| checkPermission | if true (default) check also directory permissions |
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.myParent [private] |