13 namespace swift::misc::network
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.
void append(QList< T > &&value)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
void sort(Qt::CaseSensitivity cs)
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.