TextStyle styleFromName(const char *name)
{
    for (int i = 0; i < C_LAST_STYLE_SENTINEL; ++i) {
        if (qstrcmp(name, nameForStyle(TextStyle(i))) == 0)
            return TextStyle(i);
    }
    return C_LAST_STYLE_SENTINEL;
}
Beispiel #2
0
String GemClass::styleAsString() const
{
    String out;
    for(int i = 0; i < 32; ++i)
    {
        int flag = (1 << i);
        if(_style & flag)
        {
            if(!out.isEmpty()) out += "|";
            out += nameForStyle(flag);
        }
    }
    if(out.isEmpty()) return out;
    return "(" + out + ")";
}