mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Ref T203, utility functions for remote files
This commit is contained in:
@@ -30,7 +30,7 @@ namespace BlackMisc
|
||||
//! Value object encapsulating a list of remote files.
|
||||
class BLACKMISC_EXPORT CRemoteFileList :
|
||||
public CSequence<CRemoteFile>,
|
||||
public BlackMisc::Mixin::MetaType<CRemoteFileList>
|
||||
public Mixin::MetaType<CRemoteFileList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CRemoteFileList)
|
||||
@@ -41,6 +41,9 @@ namespace BlackMisc
|
||||
//! Construct from a base class object.
|
||||
CRemoteFileList(const CSequence<CRemoteFile> &other);
|
||||
|
||||
//! From single file
|
||||
CRemoteFileList(const CRemoteFile &remoteFile);
|
||||
|
||||
//! All file names
|
||||
QStringList getNames(bool sorted = true) const;
|
||||
|
||||
@@ -51,7 +54,16 @@ namespace BlackMisc
|
||||
CRemoteFile findFirstByNameOrDefault(const QString &name) const;
|
||||
|
||||
//! Find first matching name of default
|
||||
CRemoteFile findFirstMatchingNameOrDefault(const QString &name) const;
|
||||
CRemoteFile findFirstByMatchingNameOrDefault(const QString &name) const;
|
||||
|
||||
//! Find all executable files (decided by appendix)
|
||||
CRemoteFileList findExecutableFiles() const;
|
||||
|
||||
//! Size of all files
|
||||
qint64 getTotalFileSize() const;
|
||||
|
||||
//! Size formatted
|
||||
QString getTotalFileSizeHumanReadable() const;
|
||||
|
||||
//! From our database JSON format
|
||||
static CRemoteFileList fromDatabaseJson(const QJsonArray &array);
|
||||
|
||||
Reference in New Issue
Block a user