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


C++ WString::concat方法代码示例

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


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

示例1: editRequest

void VMsgLog::editRequest( WMenuItem* )
{
    int index = _batcher->selected();
    if( index >= 0 ) {
        const char* text = *(WString*)_data[index];
        char file[101]; int line, offset; char help[51];
        if( matchLine( index, file, line, offset, help ) ) {
            WSystemHelp *sh;
            const char *hf;
            if( findHelpFile( file, &sh, 0 ) == 0 ) {
                hf = "";
            } else {
                hf = sh->getHelpFile();
            }
            WString msg;
            int resId = atoi( help ) + 1;
            WFileName filename( file );
            if( filename.needQuotes() ) {
                msg.printf( "EditFileAtPos -f\"%s\" %d %d 0 %d",
                            file, line, offset, resId );
            } else {
                msg.printf( "EditFileAtPos -f%s %d %d 0 %d",
                            file, line, offset, resId );
            }
            msg.concat( " \"" );
            msg.concat( text ); // error message
            msg.concat( "\" " );
            msg.concat( hf ); // help file
            _parent->executeCommand( msg, EXECUTE_EDITOR, "LogEdit" );
        } else {
            WMessageDialog::info( this, "Can't find a filename in '%s'", text );
        }
    }
}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:34,代码来源:vmsglog.cpp

示例2: execute

bool VpeMain::execute( const WString& cmd )
{
    if( _config->debug() && !confirm( "Starting '%s'", cmd ) ) {
        return( false );
    }
    startWait();

    size_t icount = strlen( cmd );
    for( size_t i = 0; i < icount; ) {
        WString cbuff;
        while( isspace( cmd[i] ) ) i++;
        for( ; i < icount; ) {
            char ch = cmd[i];
            i++;
            if( ch == '\n' || ch == '\r' ) break;
            cbuff.concat( ch );
        }
        if( cbuff.size() > 0 ) {
            if( strnicmp( cbuff, "!Error ", 7 ) == 0 ) {
                WString msg;
                for( size_t i = 7; i < cbuff.size() && cbuff[i] != '$'; i++ ) {
                    msg.concat( cbuff[i] );
                }
                WMessageDialog::messagef( this, MsgError, MsgOk, _viperError, msg );
                return( false );
            } else {
                if( !executeOne( cbuff ) ) {
                    return( false );
                }
            }
        }
    }
    return( true );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:34,代码来源:vpemain2.cpp

示例3: dump

void MWorkFile::dump( WFile& fil )
{
    MRule* rule = _item->rule();
    WString& mask = _component->mask();

    fil.printf( "#%FP", this );
    fil.printf( ", %s:%s", (const char*)mask, (const char*)rule->tag() );
    fil.printf( ", %s", (const char*)*this );

    WString n;
    int icount = _states.count();
    if( icount > 0 ) {
        bool first = TRUE;
        for( int i=0; i<icount; i++ ) {
            MState* st = (MState*)_states[i];
            WString temp;
            st->sw()->getText( temp, st );
            if( temp.size() > 0 ) {
                if( first ) n.concat( " (" );
                if( !first ) n.concat( ' ' );
                n.concat( temp );
                first = FALSE;
            }
        }
        if( !first ) n.concat( ')' );
    }
    fil.printf( " %s\n", (const char*)n );
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例4: expandMacroes

void MConfig::expandMacroes( WString &str ) {
    WString     tok( str );
    WString     envvar;
    unsigned    i;

    str = "";
    for( i=0; tok[i] != '\0'; i++ ) {
        if( tok[i] == '$' && tok[i+1] == '(' && tok[i+2] == '%' ) {
            envvar = "";
            i += 3;
            for( ;; i++ ) {
                if( tok[i] == '\0' ) {
                    str.concat( "$%(" );
                    str.concat( envvar );
                    str.concat( tok[i] );
                    i--; // don't let the outside loop go past the NULLCHAR
                    break;
                } else if( tok[i] == ')' ) {
                    str.concat( getenv( envvar ) );
                    break;
                } else {
                    envvar.concat( tok[i] );
                }
            }
        } else {
            str.concat( tok[i] );
        }
    }
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例5: if

void MC2Switch::addone( WString& str, bool state )
{
    if( state && _on.size() > 0 ) {
        str.concat( _on );
    } else if( !state && _off.size() > 0 ) {
        str.concat( _off );
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:8,代码来源:mc2swtch.cpp

示例6: name

void MItem::name( WString& n )
{
    n = "";
    if( !isMask() ) {
        n.concat( *this );
    } else {
        n.concat( "( " );
        n.concat( this->ext() );
        n.concat( " )" );
    }
    addDecorators( n );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:12,代码来源:mitem.cpp

示例7: kludgeMask

void MConfig::kludgeMask( WString& str )
{
    if( _kludge ) {
        WString temp;
        for( size_t i=0; i<str.size(); i++ ) {
            temp.concat( str[i] );
            if( _kludge == 3 && i == 0 ) temp.concat( '?' );
            if( _version > 1 && _kludge == 3 && i == 2 ) temp.concat( '?' );
            if( _version > 1 && _kludge == 4 && i == 3 ) temp.concat( '?' );
        }
        str = temp;
    }
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例8: sibWidth

void TreeNode::sibWidth()
//-----------------------
{
    WString     msg;
    TreeNode *  node;
    int         i;
    bool        sepInc = true;

    msg.concatf( "%s: _sibWidth = %ld; parents: ",
                        _nm ? _nm : "<>", _sibWidth );

    for( i = 0; i < getCount( ParentList ); i += 1 ) {
        node = getNode( ParentList, i );
        msg.concatf( "%s: sibContrib() = %ld; ",
                     node->_nm ? node->_nm : "<>",
                     node->getSibContrib( this, sepInc ) );
    }

    msg.concat( "children: " );
    for( i = 0; i < getCount( ChildList ); i += 1 ) {
        node = getNode( ChildList, i );
        msg.concatf( "%s: _sibWidth = %ld; ",
                     node->_nm ? node->_nm : "<>", node->_sibWidth );
    }

    WMessageDialog::message( _parent, MsgPlain, MsgOk, msg.gets(),
                            "Source Browser" );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:28,代码来源:gtbase.cpp

示例9: expand

void MComponent::expand( WString& c, const MCommand& cmd )
{
    if( cmd.size() > 0 ) {
        cmd.expand( c, _target, _config->nilTool(), _mask, NULL, _mode );
        c.concat( "\n" );
        _project->insertBlanks( c );
    }
}
开发者ID:MikeyG,项目名称:open-watcom-v2,代码行数:8,代码来源:mcompon.cpp

示例10: text

void MAction::text( WString& t )
{
    int icount = _name.size();
    for( int i=0; i<icount; i++ ) {
        if( _name[i] != '&' ) {
            t.concat( _name[i] );
        }
    }
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:9,代码来源:maction.cpp

示例11: insertBlanks

void MProject::insertBlanks( WString& s )
{
    WString ss;
    bool lineStart = true;
    for( size_t i=0; i<s.size(); i++ ) {
        if( lineStart && s[i] != ' ' && s[i] != '!' ) {
            ss.concat( ' ' );
        }
        ss.concat( s[i] );

        if( s[i] == '\n' ) {
            lineStart = true;
        } else {
            lineStart = false;
        }
    }
    s = ss;
}
开发者ID:MikeyG,项目名称:open-watcom-v2,代码行数:18,代码来源:mproject.cpp

示例12: typeDesc

void MComponent::typeDesc( WString& n )
{
    if( _config->debug() ) {
        n.concatf( "(%s)->", (const char*)_mask );
    }
    for( int i=0; i<_config->targets().count(); i++ ) {
        MTarget* tar = (MTarget*)_config->targets()[i];
        if( tar->mask() == _mask ) {
            if( _config->debug() ) {
                n.concatf( "(%s) ", (const char*)tar->mask() );
            }
            WString name;
            tar->name( name );
            n.concat( name );
            return;
        }
    }
    n.concat( "Obsolete form: Rename target type" );
}
开发者ID:MikeyG,项目名称:open-watcom-v2,代码行数:19,代码来源:mcompon.cpp

示例13: WRect

StrucView::StrucView( int x, int y, Symbol * info )
    :WBRWindow( WRect(x,y,StrucWidth,StrucHeight), "" )
    ,_listbox( new VerboseListBox( WRect( 5, 30, -5, -25 ), this ))
    ,_listobjs( new WVList )
    ,_type( new WText( this, WRect( 5, -20, -5, -2 ), NULL,
                       TextStyleLeftNoWrap | TextStyleAmpersands ))
    ,_treeRoot(NULL)
    ,_nodesSeen( new WVList )
    ,_lattice( new ClassLattice( info ) )
    ,_filter( activeProject->getFiltFlags( Filt_Members ))
//-------------------------------------------------------------------
{
    WString title = info->name();
    Symbol * sym;

    title.concat( " Structure" );
    setText( title );

    _listbox->setCallbacks( this, (cbw)&StrucView::itemSelected,
                        (bcbwi)&StrucView::keyPressed,
                        (cbw)&StrucView::itemDblClicked );
//  _listbox->setFont(stdFont);
    _listbox->select( 0 );
    _listbox->show();
//  _type->setFont(stdFont);
    _type->show();

    WPushButton * bttn;
    bttn = new WPushButton( this, WRect( 5, 2, 25, 25 ), "+" );
    bttn->onClick( this, (cbw) plusSelected );
    bttn->show();

    bttn = new WPushButton( this, WRect( 40, 2, 25, 25 ), "-" );
    bttn->onClick( this, (cbw) minusSelected );
    bttn->show();

    bttn = new WPushButton( this, WRect( 75, 2, 25, 25 ), "*" );
    bttn->onClick( this, (cbw) starSelected );
    bttn->show();

    bttn = new WPushButton( this, WRect( -70, 2, 65, 25 ), "&Filters..." );
    bttn->onClick( this, (cbw) filterSelected );
    bttn->show();

    sym = Symbol::defineSymbol( info );
    _treeRoot = new StrucViewItem( this, sym );
    reset();

    _listbox->setFocus();
    show();
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:51,代码来源:strcview.cpp

示例14: doRun

void VMsgLog::doRun()
{
    _running = TRUE;
    if( isIconic() ) {
        show( WWinStateShowNormal );
    } else {
        show();
    }
    setFocus();
    _batcher->setFocus();
    if( _cwd.size() > 0 ) {
        WString c( "cd " );
        c.concat( _cwd );
        lastCD = "";
        if( !_batserv ) {
            runCmd( c );
        } else {
            addLine( c );
            BatchChdir( _cwd );
        }
    }

    int icount = _command.size();
    for( int i=0; i<icount; ) {
        WString cbuff;
        for( ;i<icount; ) {
            char ch = _command[i++];
            if( ch == '\n' ) break;
            cbuff.concat( ch );
        }
        if( cbuff.size() > 0 ) {
            runCmd( cbuff );
        }
    }
    addLine( "Execution complete" );
    _running = FALSE;
    _parent->quickRefresh();
}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:38,代码来源:vmsglog.cpp

示例15: addDecorators

void MItem::addDecorators( WString& n )
{
    if( _config->debug() ) {
        n.concat( " '" );
        n.concat( _ruleTag );
        n.concat( "'" );
    }
    if( _states.count() > 0 ) {
        n.concat( " [sw]" );
    }
    if( !isMask() ) {
        if( _exists ) {
#ifndef __UNIX__
            if( (_attribs & _A_RDONLY) ) {
                n.concat( " [r/o]" );
            }
#endif
        } else {
            n.concat( " [n/a]" );
        }
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:22,代码来源:mitem.cpp


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