Changeset 468 for branches

Show
Ignore:
Timestamp:
01/01/11 14:36:38 (1 year ago)
Author:
sean
Message:

Added support for position arg in TraceInfo? opApply and fixed newlines for TraceInfo? toString.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/CDGC/import/object.di

    r466 r468  
    299299    { 
    300300        int opApply(scope int delegate(ref char[])); 
     301        int opApply(scope int delegate(ref size_t, ref char[])); 
    301302        string toString(); 
    302303    } 
  • branches/CDGC/src/core/runtime.d

    r467 r468  
    400400                free( framelist ); 
    401401            } 
     402 
     403            override int opApply( scope int delegate(ref char[]) dg ) 
     404            {                 
     405                return opApply( (ref size_t, ref char[] buf) 
     406                                { 
     407                                    return dg( buf ); 
     408                                } ); 
     409            } 
    402410             
    403             override int opApply( scope int delegate(ref char[]) dg ) 
     411            override int opApply( scope int delegate(ref size_t, ref char[]) dg ) 
    404412            { 
    405413                version( Posix ) 
     
    425433                { 
    426434                    auto buf = framelist[i][0 .. strlen(framelist[i])]; 
     435                    auto pos = cast(size_t)(i - FIRSTFRAME); 
    427436                    buf = fixline( buf ); 
    428                     ret = dg( buf ); 
     437                    ret = dg( pos, buf ); 
    429438                    if( ret ) 
    430439                        break; 
    431440                } 
    432                 return ret; 
     441                return ret;                 
    433442            } 
    434443 
     
    436445            { 
    437446                string buf; 
    438                 foreach( line; this ) 
    439                     buf ~= line; 
     447                foreach( i, line; this ) 
     448                    buf ~= i ? "\n" ~ line : line; 
    440449                return buf; 
    441450            } 
  • branches/CDGC/src/object_.d

    r467 r468  
    12231223    { 
    12241224        int opApply(scope int delegate(ref char[])); 
     1225        int opApply(scope int delegate(ref size_t, ref char[])); 
    12251226        string toString(); 
    12261227    }