Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3648

Show
Ignore:
Timestamp:
06/19/08 20:26:03 (3 months ago)
Author:
kris
Message:

fixes for char[]/FilePath change

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/io/vfs/ZipFolder.d

    r3605 r3648  
    2525       VfsInfo, VfsSync; 
    2626import tango.util.PathUtil : patternMatch; 
     27import Path = tango.io.Path; 
    2728 
    2829debug( ZipFolder ) 
     
    288289     * explicitly disallowed. 
    289290     */ 
    290     this(char[] path, bool readonly=false) 
     291    deprecated this(FilePath path, bool readonly=false) 
    291292    out { assert( valid ); } 
    292293    body 
     
    294295        debug( ZipFolder ) 
    295296            Stderr.formatln(`ZipFolder("{}", {})`, path, readonly); 
    296         this(FilePath(path), readonly); 
     297        this(path.toString, readonly); 
    297298    } 
    298299 
    299300    /// ditto 
    300     this(FilePath path, bool readonly=false) 
     301    this(char[] path, bool readonly=false) 
    301302    out { assert( valid ); } 
    302303    body 
     
    374375        scope(exit) if( tempFile !is null ) delete tempFile; 
    375376 
     377        auto p = Path.parse (path); 
    376378        foreach( file ; this.tree.catalog ) 
    377379        { 
     
    379381                if( zf.entry.file.zipEntry !is null ) 
    380382                { 
    381                     tempFile = new TempFile(path.path, TempFile.Permanent); 
     383                    tempFile = new TempFile(p.path, TempFile.Permanent); 
    382384                    os = tempFile.output; 
    383385                    debug( ZipFolder ) 
     
    471473     * flushed to disk. 
    472474     */ 
    473     final FilePath path() { return _path; } 
    474     final FilePath path(FilePath v) { return _path = v; } /// ditto 
     475    //deprecated final FilePath path() { return FilePath(_path); } 
     476    //deprecated final void path(FilePath v) { return _path = v.toString; } /// ditto 
     477 
     478    /** 
     479     * Allows you to read and specify the path to the archive.  The effect of 
     480     * setting this is to change where the archive will be written to when 
     481     * flushed to disk. 
     482     */ 
     483    final char[] path() { return _path; } 
     484    final char[] path(char[] v) { return _path = v; } /// ditto 
    475485 
    476486private: 
    477487    ZipReader zr; 
    478488    Entry* root; 
    479     FilePath _path; 
     489    char[] _path; 
    480490    bool _readonly; 
    481491    bool modified = false; 
     
    513523    } 
    514524 
    515     void resetArchive(FilePath path, bool readonly=false) 
     525    void resetArchive(char[] path, bool readonly=false) 
    516526    out { assert( valid ); } 
    517527    body 
     
    524534 
    525535        this.path = path; 
    526         this.readonly = readonly & !path.isWritable
    527  
    528         zr = new ZipBlockReader(path.toString); 
     536        this.readonly = readonly & !Path.isWritable(path)
     537 
     538        zr = new ZipBlockReader(path); 
    529539 
    530540        // First, create a root entry 
     
    650660    { 
    651661        assert( valid ); 
    652         assert( !FilePath(path).isAbsolute ); 
    653     } 
    654     body 
    655     { 
    656         auto fp = FilePath(path); 
     662        assert( !Path.parse(path).isAbsolute ); 
     663    } 
     664    body 
     665    { 
     666        auto fp = Path.parse(path); 
    657667        auto dir = fp.path; 
    658668        auto name = fp.file; 
     
    692702    { 
    693703        assert( valid ); 
    694         assert( !FilePath(path).isAbsolute ); 
     704        assert( !Path.parse(path).isAbsolute ); 
    695705    } 
    696706    body 
     
    846856            if( src[0..len] == dst[0..len] ) 
    847857                error(`folders "`~dst~`" and "`~src~`" in archive "` 
    848                         ~archive.path.toString~`" overlap`); 
     858                        ~archive.path~`" overlap`); 
    849859        } 
    850860    } 
     
    16401650} 
    16411651 
    1642 void headTail(ref FilePath fp, out char[] head, out char[] tail) 
     1652deprecated void headTail(ref FilePath fp, out char[] head, out char[] tail) 
    16431653{ 
    16441654    return headTail(fp.toString, head, tail);