6 #ifndef SWIFT_MISC_NETWORK_REMOTEFILE_H
7 #define SWIFT_MISC_NETWORK_REMOTEFILE_H
22 namespace swift::misc::network
33 IndexName = CPropertyIndexRef::GlobalIndexCRemoteFile,
43 CRemoteFile(
const QString &name,
const QString &description);
49 CRemoteFile(
const QString &name, qint64 size,
const QString &url);
52 const QString &
getName()
const {
return m_name; }
55 QString
getBaseName()
const {
return m_name.section(
'/', -1); }
58 bool hasName()
const {
return !m_name.isEmpty(); }
61 QString getBaseNameAndSize()
const;
64 void setName(
const QString &name) { m_name = name.trimmed(); }
67 bool matchesBaseName(
const QString &baseName)
const;
73 void setDescription(
const QString &description) { m_description = description.trimmed(); }
79 bool hasUrl()
const {
return !m_url.isEmpty(); }
82 CUrl getSmartUrl()
const;
88 bool isExecutableFile()
const;
91 bool isSwiftInstaller()
const;
97 void setUrl(
const QString &url);
103 QString getSizeHumanReadable()
const;
109 QString getFormattedCreatedYmdhms()
const;
112 QString convertToQString(
bool i18n =
false)
const;
121 static CRemoteFile fromDatabaseJson(
const QJsonObject &json);
125 QString m_description;
128 qint64 m_created = 0;
Non-owning reference to a CPropertyIndex with a subset of its features.
Mix of the most commonly used mixin classes.
ColumnIndex
Base class enums.
void setDescription(const QString &description)
Description.
QString getBaseName() const
Name with directory stripped.
void setSize(qint64 size)
Set size.
bool isFileWithSuffix() const
File with appendix.
void setName(const QString &name)
Name.
qint64 getSize() const
Get size.
const CUrl & getUrl() const
Get URL.
const QString & getDescription() const
Description.
bool hasName() const
Has name?
CRemoteFile()=default
Constructor.
bool hasUrl() const
Has an URL.
void setUrl(const CUrl &url)
Set URL.
const QString & getName() const
Name.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...