Changeset 67

Show
Ignore:
Timestamp:
09/02/07 18:27:36 (1 year ago)
Author:
stonecobra
Message:

ability to do foreach on each column of a row

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dbi/Row.d

    r59 r67  
    162162    } 
    163163 
     164        /** 
     165     * Ability to do a foreach of each column. 
     166     */ 
     167        int opApply(int delegate(inout char[], inout char[]) dg) { 
     168               int result = 0; 
     169 
     170               for (int i = 0; i < fieldNames.length; i++) { 
     171                   result = dg(fieldNames[i], fieldValues[i]); 
     172                   if (result) 
     173                   break; 
     174               } 
     175               return result; 
     176        } 
     177 
    164178    private: 
    165179    char[][] fieldNames;