mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #883, utility functions
* get executable names * containsApplication
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7bc53ada3e
commit
c8c18b0b21
@@ -13,5 +13,12 @@ namespace BlackMisc
|
||||
{
|
||||
CApplicationInfoList::CApplicationInfoList() = default;
|
||||
|
||||
CApplicationInfoList::CApplicationInfoList(const CSequence<CApplicationInfo> &other) : CSequence<CApplicationInfo>(other) {}
|
||||
CApplicationInfoList::CApplicationInfoList(const CSequence<CApplicationInfo> &other) :
|
||||
CSequence<CApplicationInfo>(other)
|
||||
{}
|
||||
|
||||
bool CApplicationInfoList::containsApplication(CApplicationInfo::Application application) const
|
||||
{
|
||||
return this->contains(&CApplicationInfo::application, application);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ namespace BlackMisc
|
||||
|
||||
//! Construct from base class object.
|
||||
CApplicationInfoList(const CSequence<CApplicationInfo> &other);
|
||||
|
||||
//! List containing entry for CApplicationInfo::Application ?
|
||||
bool containsApplication(CApplicationInfo::Application application) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -306,4 +306,17 @@ namespace BlackMisc
|
||||
});
|
||||
return it->filePath();
|
||||
}
|
||||
|
||||
QStringList getSwiftExecutablesImpl()
|
||||
{
|
||||
static const QFileInfo mySelf = QFileInfo(QCoreApplication::applicationFilePath()); // path + dir
|
||||
static const QStringList filter("*." + mySelf.suffix());
|
||||
return mySelf.dir().entryList(filter);
|
||||
}
|
||||
|
||||
const QStringList &CFileUtils::getSwiftExecutables()
|
||||
{
|
||||
static const QStringList executables(getSwiftExecutablesImpl());
|
||||
return executables;
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -112,6 +112,9 @@ namespace BlackMisc
|
||||
|
||||
//! Returns path to the newest file in dir, optionally matching a wildcard, or empty string.
|
||||
static QString findNewestFile(const QDir &dir, bool recursive, const QStringList &nameFilters = {}, const QStringList &excludeDirectories = {});
|
||||
|
||||
//! Get all swift executables
|
||||
static const QStringList &getSwiftExecutables();
|
||||
};
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user