当前位置: 首页>>代码示例>>C++>>正文


C++ WrapperStr::remove方法代码示例

本文整理汇总了C++中WrapperStr::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ WrapperStr::remove方法的具体用法?C++ WrapperStr::remove怎么用?C++ WrapperStr::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WrapperStr的用法示例。


在下文中一共展示了WrapperStr::remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: write_cpp_returntype

void UmlOperation::write_cpp_returntype(FileOut & out, WrapperStr decl)
{
    // doesn't manage function pointer
    // manage keywords
    int index;

    if ((index = decl.find("${static}")) != -1)
        decl.remove(index, 9);

    if ((index = decl.find("${friend}")) != -1)
        decl.remove(index, 9);

    if ((index = decl.find("${virtual}")) != -1)
        decl.remove(index, 10);

    if ((index = decl.find("${inline}")) != -1)
        decl.remove(index, 9);

    if ((index = decl.find("${(}")) == -1)
        decl = "${type} ${name}";
    else
        decl.truncate(index);

    UmlTypeSpec t = returnType();

    if ((t.type != 0) ||
        !(t.explicit_type = CppSettings::type(t.explicit_type)).isEmpty())
        write_type(out, t, decl, "${name}", "${type}");
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:29,代码来源:UmlOperation.cpp

示例2: remove_comments

void UmlClassMember::remove_comments(WrapperStr & s)
{
    int index1 = 0;

    if ((index1 = s.find("${comment}")) != -1)
        s.remove((unsigned) index1, 10);
    else if ((index1 = s.find("${description}")) != -1)
        s.remove((unsigned) index1, 14);

    while ((index1 = s.find('/', index1)) != -1) {
        int index2;

        switch (((const char *) s)[index1 + 1]) {
        case '/':
            if ((index2 = s.find('\n', index1 + 2)) != -1)
                s.remove(index1, index2 - index1 + 1);
            else
                s.truncate(index1);

            break;

        case '*':
            if ((index2 = s.find("*/", index1 + 2)) != -1)
                s.replace(index1, index2 - index1 + 1, " ");
            else
                s.truncate(index1);

            break;

        default:
            index1 += 1;
        }
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:34,代码来源:UmlClassMember.cpp

示例3: write_java_returntype

void UmlOperation::write_java_returntype(FileOut & out, WrapperStr decl)
{
// manage keywords
    int index;

    if ((index = decl.find("${visibility}")) != -1)
        decl.remove(index, 13);

    if ((index = decl.find("${final}")) != -1)
        decl.remove(index, 8);

    if ((index = decl.find("${static}")) != -1)
        decl.remove(index, 9);

    if ((index = decl.find("${abstract}")) != -1)
        decl.remove(index, 11);

    if ((index = decl.find("${synchronized}")) != -1)
        decl.remove(index, 15);

    if ((index = decl.find("${@}")) != -1)
        decl.remove(index, 4);

    if ((index = decl.find("${(}")) == -1)
        decl = "${type} ${name}";
    else
        decl.truncate(index);

    UmlTypeSpec t = returnType();

    if ((t.type != 0) ||
        !(t.explicit_type = JavaSettings::type(t.explicit_type)).isEmpty())
        write_type(out, t, decl, "${name}", "${type}");
}
开发者ID:bleakxanadu,项目名称:douml,代码行数:34,代码来源:UmlOperation.cpp

示例4: remove_python_comments

void remove_python_comments(WrapperStr & s)
{
    int index1 = 0;

    while ((index1 = s.find('#', index1)) != -1) {
        int index2;

        if ((index2 = s.find('\n', index1 + 1)) != -1)
            s.remove(index1, index2 - index1 + 1);
        else
            s.truncate(index1);
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:13,代码来源:strutil.cpp

示例5: remove_preprocessor

void UmlClassMember::remove_preprocessor(WrapperStr & s)
{
    int index = 0;

    while ((index = s.find('#', index)) != -1) {
        // remove all up to the end of line
        int index2 = index + 1;
        int index3;

        while ((index3 = s.find('\n', index2)) != -1) {
            // manage multi lines #define
            if (((const char *) s)[index3 - 1] != '\\')
                break;
            else
                index2 = index3 + 1;
        }

        // the \n is still here to have a separator
        if (index3 == -1)
            s.truncate(index);
        else
            s.remove(index, index3 - index);
    }
}
开发者ID:harmegnies,项目名称:douml,代码行数:24,代码来源:UmlClassMember.cpp

示例6: compute_dependency

void UmlRelation::compute_dependency(Q3PtrList<CppRefType> & dependencies,
                                     const WrapperStr & cl_stereotype,
                                     bool all_in_h)
{
    if (cl_stereotype == "enum")
        return;

    switch (relationKind()) {
    case aDependency:
        if (stereotype() == "friend")
            break;

        CppRefType::add(roleType(), dependencies, cppDecl() != "#include in source",
                        roleType()->isCppExternal());
        break;

    case aGeneralisation:
    case aRealization:
        CppRefType::add(roleType(), dependencies, TRUE);
        break;

    default:
        WrapperStr decl = cppDecl();
        int index;

        if ((index = decl.find("${static}")) != -1)
            decl.remove((unsigned) index, 9);

        if ((index = decl.find("${mutable}")) != -1)
            decl.remove((unsigned) index, 10);

        if ((index = decl.find("${volatile}")) != -1)
            decl.remove((unsigned) index, 11);

        if ((index = decl.find("${const}")) != -1)
            decl.remove((unsigned) index, 8);

        if ((index = decl.find("${multiplicity}")) != -1)
            decl.remove((unsigned) index, 15);

        if ((index = decl.find("${name}")) != -1)
            decl.remove((unsigned) index, 7);

        if ((index = decl.find("${inverse_name}")) != -1)
            decl.remove((unsigned) index, 15);

        if ((index = decl.find("${value}")) != -1)
            decl.remove((unsigned) index, 8);

        if ((index = decl.find("${h_value}")) != -1)
            decl.remove((unsigned) index, 10);

        if ((index = decl.find("${stereotype}")) != -1)
            decl.replace((unsigned) index, 13,
                         CppSettings::relationAttributeStereotype(stereotype()));

        if ((index = decl.find("${association}")) != -1) {
            decl.replace((unsigned) index, 14,
                         association().toString());
        }

        replace_alias(decl);

        UmlTypeSpec type;

        type.type = roleType();
        UmlClassMember::compute_dependency(dependencies, decl, type, all_in_h);
    }
}
开发者ID:harmegnies,项目名称:douml,代码行数:69,代码来源:UmlRelation.cpp

示例7: compute_dependency

void UmlClass::compute_dependency(QList<CppRefType *> & dependencies,
                                  const WrapperStr &, bool all_in_h)
{
    QVector<UmlItem*> ch = children();
    const WrapperStr stereotype = cpp_stereotype();
    bool a_typedef = (stereotype == "typedef");
    bool an_enum = (stereotype == "enum");
    const QList<UmlFormalParameter> formals = this->formals();
    const QList<UmlActualParameter> actuals = this->actuals();

    if (!formals.isEmpty())
        // template class, force depend in h
        all_in_h = TRUE;

    for (int index = 0; index != ch.size(); index += 1) {
        if (ch[index]->kind() != aNcRelation) {
            UmlClassItem * it = (UmlClassItem *) ch[index];

            if (! it->cppDecl().isEmpty())
                it->compute_dependency(dependencies, stereotype, all_in_h);
        }
    }

    if (an_enum && (!formals.isEmpty() || !actuals.isEmpty())) {
        write_trace_header();
        UmlCom::trace("&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\"><b><i>template enum</i></b></font><br>");
        incr_warning();
    }
    else if (a_typedef && !formals.isEmpty()) {
        write_trace_header();
        UmlCom::trace("&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\"><b><i>template typedef</i></b></font><br>");
        incr_warning();
    }
    else {
        QList<UmlFormalParameter>::ConstIterator itf;

        for (itf = formals.begin(); itf != formals.end(); ++itf)
            CppRefType::remove((*itf).name(), dependencies);

        QList<UmlActualParameter>::ConstIterator ita;

        for (ita = actuals.begin(); ita != actuals.end(); ++ita)
            UmlClassMember::compute_dependency(dependencies, "${type}",
                                               (*ita).value(), all_in_h);

        if (a_typedef) {
            WrapperStr decl = cppDecl();
            int index;

            remove_comments(decl);

            if ((index = decl.find("${name}")) != -1)
                decl.remove((unsigned) index, 7);

            replace_alias(decl);

            UmlClassMember::compute_dependency(dependencies, decl,
                                               baseType(), all_in_h);
        }
    }

    if ((associatedArtifact() == 0) ||
        (associatedArtifact()->associatedClasses().count() == 1))
        CppRefType::remove(this, dependencies);
    else
        CppRefType::force_ref(this, dependencies);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:67,代码来源:UmlClass.cpp


注:本文中的WrapperStr::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。