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

Changeset 3647

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

update to focus on char[] paths instead of FilePath?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/io/compress/Zip.d

    r3604 r3647  
    4040import tango.time.chrono.Gregorian : Gregorian; 
    4141 
     42import Path = tango.io.Path; 
    4243import Integer = tango.text.convert.Integer; 
    4344 
     
    541542    void finish(); 
    542543    void putFile(ZipEntryInfo info, char[] path); 
    543     void putFile(ZipEntryInfo info, PathView path); 
     544    deprecated void putFile(ZipEntryInfo info, PathView path); 
     545    void putFile(ZipEntryInfo info, char[] path); 
    544546    void putStream(ZipEntryInfo info, InputStream source); 
    545547    void putEntry(ZipEntryInfo info, ZipEntry entry); 
     
    586588     * filesystem. 
    587589     */ 
     590    deprecated this(PathView path) 
     591    { 
     592        this(path.toString); 
     593    } 
     594 
     595    /// ditto 
    588596    this(char[] path) 
    589     { 
    590         this(FilePath(path)); 
    591     } 
    592  
    593     /// ditto 
    594     this(PathView path) 
    595597    { 
    596598        file_source = new FileConduit(path); 
     
    991993     * filesystem. 
    992994     */ 
     995    deprecated this(FilePath path) 
     996    { 
     997        this(path.toString); 
     998    } 
     999 
     1000    /// ditto 
    9931001    this(char[] path) 
    994     { 
    995         this(FilePath(path)); 
    996     } 
    997  
    998     /// ditto 
    999     this(PathView path) 
    10001002    { 
    10011003        file_output = new FileConduit(path, FileConduit.WriteCreate); 
     
    10391041     * Adds a file from the local filesystem to the archive. 
    10401042     */ 
     1043    deprecated void putFile(ZipEntryInfo info, PathView path) 
     1044    { 
     1045        putFile(info, path.toString); 
     1046    } 
     1047 
     1048    /// ditto 
    10411049    void putFile(ZipEntryInfo info, char[] path) 
    1042     { 
    1043         putFile(info, FilePath(path)); 
    1044     } 
    1045  
    1046     /// ditto 
    1047     void putFile(ZipEntryInfo info, PathView path) 
    10481050    { 
    10491051        scope file = new FileConduit(path); 
     
    17491751} 
    17501752 
    1751 void createArchive(PathView archive, Method method, PathView[] files...) 
    1752 { 
    1753     scope zw = new ZipBlockWriter(archive); 
     1753deprecated void createArchive(PathView archive, Method method, PathView[] files...) 
     1754{ 
     1755    scope zw = new ZipBlockWriter(archive.toString); 
    17541756    zw.method = method; 
    17551757 
    17561758    foreach( file ; files ) 
    1757         zw.putFile(ZipEntryInfo(file.toString), file); 
     1759        zw.putFile(ZipEntryInfo(file.toString), file.toString); 
    17581760 
    17591761    zw.finish; 
    17601762} 
    17611763 
    1762 void extractArchive(char[] archive, char[] folder) 
    1763 
    1764     extractArchive(FilePath(archive), FilePath(folder)); 
    1765 
    1766  
    1767 void extractArchive(PathView archive, PathView dest) 
    1768 
    1769     scope folder = FilePath(dest.toString); 
     1764deprecated void extractArchive(FilePath archive, char[] folder) 
     1765
     1766    extractArchive(archive, folder); 
     1767
     1768 
     1769deprecated void extractArchive(PathView archive, PathView dest) 
     1770
     1771        extractArchive (archive.toString, dest.toString); 
     1772
     1773 
     1774void extractArchive(char[] archive, char[] dest) 
     1775
    17701776    scope zr = new ZipBlockReader(archive); 
    17711777 
     
    17751781        if( entry.info.name[$-1] == '/' ) continue; 
    17761782 
    1777         auto path = folder.dup.append(entry.info.name); 
     1783        auto path = Path.join(dest, entry.info.name); 
    17781784        scope fout = new FileConduit(path, FileConduit.WriteCreate); 
    17791785        fout.output.copy(entry.open);