Ref T515, utility functions for file name/path etc.

This commit is contained in:
Klaus Basan
2019-01-17 16:41:03 +01:00
committed by Mat Sutcliffe
parent a0c8f3778b
commit 107464d92a
6 changed files with 48 additions and 1 deletions

View File

@@ -40,6 +40,7 @@
#include <QStringList>
#include <Qt>
#include <QFileInfo>
#include <QDir>
#include <tuple>
namespace BlackMisc
@@ -420,14 +421,24 @@ namespace BlackMisc
// ---------------- simulator file related functions -------------------
//! File name (corresponding data for simulator, only available if representing simulator model
//! \remark normally parh and name, like with QFile name
const QString &getFileName() const { return m_fileName; }
//! File name as lower case
QString getFileNameLowerCase() const { return m_fileName.toLower(); }
//! File name?
bool hasFileName() const { return !m_fileName.isEmpty(); }
//! Does the corresponding file exist?
bool hasExistingCorrespondingFile() const;
//! Directory
QDir getFileDirectory() const;
//! Directory path if any
QString getFileDirectoryPath() const;
//! File name
void setFileName(const QString &fileName) { m_fileName = fileName; }