13 namespace swift::misc::network
21 QStringList fileNames;
23 if (
sorted) { fileNames.sort(); }
29 QStringList fileNames;
31 if (
sorted) { fileNames.sort(); }
46 if (rf.
getName().contains(name, cs)) {
return rf; }
static QString humanReadableFileSize(qint64 size)
Human readable (GB, MB, ..) file size.
static bool isExecutableFile(const QString &fileName)
Executable file (decided by appendix)
auto findFirstByOrDefault(Predicate p, const Value &def) const
Return a copy of the first element for which a given predicate returns true, or a default value if th...
Q_REQUIRED_RESULT CSequence sorted(Predicate p) const
Return a copy sorted by a given comparator predicate.
void push_back(const T &value)
Appends an element at the end of the sequence.
bool matchesBaseName(const QString &baseName) const
Matching name?
qint64 getSize() const
Get size.
QString getBaseNameAndSize() const
Name + human readable size.
static CRemoteFile fromDatabaseJson(const QJsonObject &json)
Role from DB JSON.
const QString & getName() const
Name.
Value object encapsulating a list of remote files.
CRemoteFile findFirstContainingNameOrDefault(const QString &name, Qt::CaseSensitivity cs) const
First by name contained of default.
QStringList getBaseNamesPlusSize(bool sorted=true) const
All file names plus size.
QString getTotalFileSizeHumanReadable() const
Size formatted.
QStringList getNames(bool sorted=true) const
All file names.
CRemoteFileList findExecutableFiles() const
Find all executable files (decided by appendix)
CRemoteFileList()
Default constructor.
static CRemoteFileList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
CRemoteFile findFirstByNameOrDefault(const QString &name) const
First by name of default.
CRemoteFile findFirstByMatchingBaseNameOrDefault(const QString &name) const
Find first matching name of default.
qint64 getTotalFileSize() const
Size of all files.
QJsonArray jsonArrayFromString(const QString &json)
JSON Array from string.
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.