12 namespace swift::misc::network
25 for (
const QString &r : roles)
27 if (this->
hasRole(r)) {
return true; }
36 QStringList rolesString;
37 rolesString.reserve(
size());
38 for (
const CRole &role : (*
this)) { rolesString.append(role.getName()); }
39 return rolesString.join(separator);
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
size_type size() const
Returns number of elements in the sequence.
void push_back(const T &value)
Appends an element at the end of the sequence.
static CRole fromDatabaseJson(const QJsonObject &json)
Role from DB JSON.
const QString & getName() const
Name.
Value object encapsulating a list of servers.
QString namesAsString(const QString &separator=", ") const
Roles as string.
CRoleList()
Default constructor.
static CRoleList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
bool hasRole(const QString &roleName) const
Has role?
bool hasAnyRole(const QStringList &roles) const
Has any role?
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.