コード例 #1
0
QString TextFormatter::getFormattedSection(QDomNode sectionNode)
{
    QDomNodeList itemChildNodes = sectionNode.childNodes();
    QString formattedSection = "";

    for(int i = 0; i < itemChildNodes.length(); i++)
    {
        QDomNode currentNode = itemChildNodes.at(i);
        QString nodeName = currentNode.nodeName();

        if(nodeName.compare("header") == 0)
        {
            formattedSection += getFormattedHeader(currentNode);
        }
        else if(nodeName.compare("description") == 0)
        {
            formattedSection += getFormattedDescription(currentNode);
        }
        else if(nodeName.compare("list") == 0)
        {
            formattedSection += getFormattedList(currentNode);
        }
    }

    formattedSection.append("<br/>");

    return formattedSection;
}
コード例 #2
0
QString ListItem::modifiedDescription(){
    QString descript = getFormattedDescription();
    descript = descript.simplified();

    QString homeDir = QDir::homePath();
    if(descript.startsWith(homeDir)){
        descript.remove(0,(homeDir.length()));
        descript.prepend(HOME_ABREV);
    }
    return descript;
}
コード例 #3
0
const std::string TypeUtil::getDescription(const EDIType* aEDIType) {
    std::string string;
    string = aEDIType->getDescription(PRINT_SKIP_UNIONS, PRINT_SKIP_STRUCTS, PRINT_MULTI_NAMES);
    if(VERBOSE_LEVEL > 0) {
        string = getFormattedDescription(string);
    }
    if(VERBOSE_LEVEL > 1) {
        raw_string_ostream ostream(string);
        ostream << "\n\t";
        aEDIType->getDIType()->print(ostream);
        ostream.flush();
    }
    return string;
}
コード例 #4
0
const std::string TypeUtil::getDescription(TYPECONST Type* type,
    size_t max_chars /*= 0*/, size_t max_levels /*= 0*/) {
    std::string string;
    if(!PRINT_SKIP_UNIONS && !PRINT_SKIP_STRUCTS && PRINT_USE_BUILTIN_PRINTING) {
    string = PassUtil::getTypeDescription(type);
    }
    else {
        raw_string_ostream ostream(string);
        printTypeString(ostream, type, max_chars, max_levels);
        ostream.flush();
    }
    if(VERBOSE_LEVEL > 0) {
        string = getFormattedDescription(string);
    }
    return string;
}
コード例 #5
0
QString TextFormatter::getFormattedItem(QDomNode itemNode)
{
    QDomNodeList itemChildNodes = itemNode.childNodes();
    QString formattedItem = "";

    for(int i = 0; i < itemChildNodes.length(); i++)
    {
        QDomNode currentNode = itemChildNodes.at(i);
        QString nodeName = currentNode.nodeName();

        if(nodeName.compare("title") == 0)
        {
            formattedItem += getFormattedTitle(currentNode);
        }
        else if(nodeName.compare("description") == 0)
        {
            formattedItem += getFormattedDescription(currentNode);
        }
    }
    return formattedItem;
}