Пример #1
0
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 );
}
Пример #2
0
void writeEditor( WFile &ifile, char *edtext, char *isdlltext,
                        WFileName &editor, bool isdll, bool thisos ) {
    // the WFileName class has no != operator
    if( ( !thisos && !( editor == "" ) )
        || ( thisos && !( editor == _config->editor() ) )
        || ( thisos && isdll != _config->editorIsDLL() ) ) {
        ifile.printf( "%s=%s\n", edtext, editor.gets() );
        ifile.printf( "%s=%d\n", isdlltext, isdll );
    }
}
Пример #3
0
bool MComponent::writeCBR( bool mustExist )
{
    bool found_a_mbr = false;
    if( mustExist )
        found_a_mbr = true;
    for( int i=0; i<_workFiles.count(); i++ ) {
        MWorkFile* w = (MWorkFile*)_workFiles[i];
        if( w->browseable() ) {
            WFileName browfile( _filename );
            browfile.setExt( ".cbr" );
            WFile brow;
            if( brow.open( browfile, OStyleWrite ) ) {
                WFileName tfile;
                _target->absResult( tfile );
                tfile.setExt( "dbr" );
                brow.printf( "d %s\n", (const char*)tfile );
                for( ; i<_workFiles.count(); i++ ) {
                    MWorkFile* w = (MWorkFile*)_workFiles[i];
                    if( w->browseable() ) {
                        w->item()->absResult( tfile );
                        tfile.setExt( "mbr" );
                        if( mustExist ) {
                            if( access( (const char*)tfile, F_OK ) == 0 )  {
                                // file must be there
                                brow.printf( "f %s\n", (const char*)tfile );
                                found_a_mbr = true;
                            }
                        } else {
                            brow.printf( "f %s\n", (const char*)tfile );
                        }
                    }
                }
                brow.close();
            }
            if( found_a_mbr ) return( true );
        }
    }
    return( false );
}