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

Changeset 3887

Show
Ignore:
Timestamp:
08/18/08 14:44:53 (4 months ago)
Author:
keinfarbton
Message:

merged from trunk -r 3830:3855

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/D2.0/dsss.conf

    r3886 r3887  
    4040version(!Windows) { 
    4141    exclude += tango/sys/win32/CodePage.d 
     42    exclude += tango/sys/win32/SpecialPath.d 
    4243} 
    4344 
  • branches/experimental/D2.0/example/dsss.conf

    r3886 r3887  
    11[concurrency/fiber_test.d] 
    22buildflags += -unittest 
     3 
    34[conduits/composite.d] 
    45[conduits/createzip.d] 
     
    2223[conduits/shuffle.d] 
    2324[conduits/unifile.d] 
     25 
    2426[console/hello.d] 
    2527[console/stdout.d] 
     28 
    2629[logging/chainsaw.d] 
    2730[logging/logging.d] 
    2831[logging/multilog.d] 
     32 
    2933[manual/chapterStorage.d] 
     34 
    3035[networking/homepage.d] 
    3136[networking/httpget.d] 
     
    3338[networking/sockethello.d] 
    3439[networking/socketserver.d] 
     40 
    3541#[system/arguments.d] 
    3642[system/localtime.d] 
    3743[system/normpath.d] 
    3844[system/process.d] 
     45 
    3946[text/formatalign.d] 
    4047[text/formatindex.d] 
     
    4350[text/token.d] 
    4451[text/xmldom.d] 
    45 buildflags += -Jtext 
    4652[text/xmlpull.d] 
    47 buildflags += -Jtext 
    4853[text/xmlsax.d] 
    49 buildflags += -Jtext 
    5054[text/xmlpath.d] 
     55 
     56[vfs/vfscan.d] 
     57[vfs/vfscanregex.d] 
     58[vfs/vfshuffle.d] 
    5159[vfs/vfszip.d] 
    5260version (Windows) { 
  • branches/experimental/D2.0/example/jake-all.bat

    r3724 r3887  
    7474@jake text\xmlsax.d -I.. -op 
    7575 
     76@rem ########################################################################### 
     77@rem # VFS EXAMPLES 
     78@rem ########################################################################### 
     79 
     80@jake vfs\vfscan.d -I.. -op 
     81@jake vfs\vfscanregex.d -I.. -op 
     82@jake vfs\vfshuffle.d -I.. -op 
     83@jake vfs\vfszip.d -I.. -op -L"zlib;libbz2" 
     84 
    7685@rem FINI 
    7786 
  • branches/experimental/D2.0/tango/io/Buffer.d

    r3726 r3887  
    710710                          else 
    711711                             // no more space in the buffer? 
    712                              if (writable is 0
     712                             if (writable is 0 && expand(0) is 0
    713713                                 error ("Token is too large to fit within buffer"); 
    714714 
     
    11121112                   extent += size; 
    11131113                   } 
     1114        } 
     1115 
     1116        /*********************************************************************** 
     1117 
     1118                Expand existing buffer space 
     1119 
     1120                Returns: 
     1121                Available space, without any expansion 
     1122 
     1123                Remarks: 
     1124                Make some additional room in the buffer, of at least the  
     1125                given size. This can be used by subclasses as appropriate 
     1126                                      
     1127        ***********************************************************************/ 
     1128 
     1129        protected uint expand (uint size) 
     1130        { 
     1131                return writable; 
    11141132        } 
    11151133 
     
    15181536 
    15191537                   if (size + index > dimension) 
    1520                        makeRoom (size); 
     1538                       expand (size); 
    15211539 
    15221540                   // populate tail of buffer with new content 
     
    15431561        { 
    15441562                if (length > writable) 
    1545                     makeRoom (length); 
     1563                    expand (length); 
    15461564 
    15471565                copy (src, length); 
     
    15611579        { 
    15621580                if (writable <= increment/8) 
    1563                     makeRoom (increment); 
     1581                    expand (increment); 
    15641582 
    15651583                return write (&src.read); 
     
    15851603        /*********************************************************************** 
    15861604 
    1587                 make some room in the buffer 
    1588  
    1589         ***********************************************************************/ 
    1590  
    1591         private uint makeRoom (uint size) 
     1605                Expand existing buffer space 
     1606 
     1607                Returns: 
     1608                Available space after adjustment 
     1609 
     1610                Remarks: 
     1611                Make some additional room in the buffer, of at least the  
     1612                given size. This can be used by subclasses as appropriate 
     1613                                      
     1614        ***********************************************************************/ 
     1615 
     1616        override uint expand (uint size) 
    15921617        { 
    15931618                if (size < increment) 
     
    15961621                dimension += size; 
    15971622                data.length = dimension; 
    1598                 return writable()
     1623                return writable
    15991624        } 
    16001625} 
  • branches/experimental/D2.0/tango/io/Conduit.d

    r3726 r3887  
    2222 
    2323        Conduit abstract base-class, implementing interface IConduit. 
    24         Only the conduit-specific read(), write(), fileHandle() and 
    25         bufferSize() need to be implemented for a concrete conduit 
     24        Only the conduit-specific read(), write(), and  
     25        bufferSize() need to be implemented for a concrete conduit  
    2626        implementation. See FileConduit for an example. 
    2727 
     
    3939*******************************************************************************/ 
    4040 
    41 class Conduit : IConduit, ISelectable 
     41class Conduit : IConduit 
    4242{ 
    4343        /*********************************************************************** 
     
    5656 
    5757        abstract uint bufferSize (); 
    58  
    59         /*********************************************************************** 
    60  
    61                 Models a handle-oriented device. We need to revisit this 
    62  
    63                 TODO: figure out how to avoid exposing this in the general 
    64                 case 
    65  
    66         ***********************************************************************/ 
    67  
    68         abstract Handle fileHandle (); 
    6958 
    7059        /*********************************************************************** 
     
    459448 
    460449 
     450 
  • branches/experimental/D2.0/tango/io/DeviceConduit.d

    r3724 r3887  
    2727*******************************************************************************/ 
    2828 
    29 class DeviceConduit : Conduit 
     29class DeviceConduit : Conduit, ISelectable 
    3030{ 
    3131        /// expose in superclass definition also 
     
    9292                ***************************************************************/ 
    9393 
    94                 final override Handle fileHandle () 
     94                final Handle fileHandle () 
    9595                { 
    9696                        return cast(Handle) handle; 
     
    241241 
    242242 
     243 
  • branches/experimental/D2.0/tango/io/FilePath.d

    r3886 r3887  
    1414        author:         Kris 
    1515 
    16         FilePath combined a means of efficiently editing and extracting 
    17         path components and of accessing the underlying file system. 
    18  
    19         Use module Path.d instead when you need only pedestrian access to 
    20         the file-system, and are not manipulating the path components. Use 
    21         FilePath for other scenarios, since it will often be notably more 
    22         efficient 
     16        FilePath provides a means to efficiently edit path components and  
     17        of accessing the underlying file system. 
     18 
     19        Use module Path.d instead when you need pedestrian access to the 
     20        file-system, and are not mutating the path components themselves 
    2321 
    2422*******************************************************************************/ 
     
    5149 
    5250        FilePath is designed to be transformed, thus each mutating method 
    53         modifies the internal content. There is a read-only base-class 
    54         called PathView, which can be used to provide a view into the 
    55         content as desired. 
     51        modifies the internal content.  
    5652 
    5753        Note that patterns of adjacent '.' separators are treated specially 
    58         in that they will be assigned to the name instead of the suffix. In 
    59         addition, a '.' at the start of a name signifies it does not belong 
    60         to the suffix i.e. ".file" is a name rather than a suffix. 
    61  
    62         Note also that normalization of path-separators occurs by default. 
    63         This means that the use of '\' characters will be converted into 
    64         '/' instead while parsing. To mutate the path into an O/S native 
    65         version, use the native() method. To obtain a copy instead, use the 
    66         path.dup.native sequence 
     54        in that they will be assigned to the name where there is no distinct 
     55        suffix. In addition, a '.' at the start of a name signifies it does  
     56        not belong to the suffix i.e. ".file" is a name rather than a suffix. 
     57        Patterns of intermediate '.' characters will otherwise be assigned 
     58        to the suffix, such that "file....suffix" includes the dots within 
     59        the suffix itself [see ext() for a suffix without dots]. 
    6760 
    6861*******************************************************************************/ 
     
    121114        this (Cutf8 filepath = null) 
    122115        { 
    123                 set (filepath); 
     116                set (filepath, true); 
    124117        } 
    125118 
     
    435428        FilePath set (FilePath path) 
    436429        { 
    437                 return set (path.toString); 
    438         } 
    439  
    440         /*********************************************************************** 
    441  
    442                 Reset the content of this path, and reparse. 
    443  
    444         ***********************************************************************/ 
    445  
    446         final FilePath set (Cutf8 path) 
     430                return set (path.toString, false); 
     431        } 
     432 
     433        /*********************************************************************** 
     434 
     435                Reset the content of this path, and reparse. There's an 
     436                optional boolean flag to convert the path into standard 
     437                form, before parsing (converting '\' into '/') 
     438 
     439        ***********************************************************************/ 
     440 
     441        final FilePath set (Cutf8 path, bool convert = false) 
    447442        { 
    448443                p.end_ = path.length; 
     
    450445                expand (p.end_); 
    451446                if (p.end_) 
    452                     p.fp[0 .. p.end_] = path; 
     447                   { 
     448                   p.fp[0 .. p.end_] = path; 
     449                   if (convert) 
     450                       .standard (p.fp [0 .. p.end_]); 
     451                   } 
    453452 
    454453                p.fp[p.end_] = '\0'; 
     
    621620        /*********************************************************************** 
    622621 
    623                 Parse the path spec 
     622                Parse the path spec, and mutate '\' into '/' as necessary 
    624623 
    625624        ***********************************************************************/ 
     
    928927        { 
    929928                FS.rename (cString, dst~'\0'); 
    930                 return this.set (dst); 
     929                return this.set (dst, true); 
    931930        } 
    932931 
     
    13591358                fp = new FilePath(r"C:/foo/bar/test.bar"); 
    13601359                assert (fp.path == "C:/foo/bar/"); 
    1361                 fp = new FilePath(r"C:/foo/bar/test.bar"); 
     1360                fp = new FilePath(r"C:\foo\bar\test.bar"); 
    13621361                assert (fp.path == r"C:/foo/bar/"); 
    13631362 
  • branches/experimental/D2.0/tango/io/Path.d

    r3886 r3887  
    1111        A more direct route to the file-system than FilePath, but with  
    1212        the potential overhead of heap activity. Use this if you don't 
    13         need path editing or extraction features. For example, if all 
    14         you want is to see if some path exists, using this module might  
    15         be a more convenient option than FilePath
     13        need path editing features. For example, if all you want is to  
     14        see if some path exists, using this module would likely be more  
     15        convenient than FilePath. For example
    1616        --- 
    1717        if (exists ("some/file/path"))  
     
    1919        --- 
    2020 
    21         These functions can be less efficient than FilePath because they  
     21        These functions may be less efficient than FilePath because they  
    2222        may have to attach a null to the filename for each underlying O/S 
    2323        call. Use Path when you need pedestrian access to the file-system,  
    24         and are not manipulating the path components. Use FilePath for other 
    25         scenarios
     24        and are not manipulating the path components. Use FilePath where 
     25        path editing or mutation is desired
    2626 
    2727        We encourage the use of "scoped import" with this module, such as 
     
    160160        static void exception (char[] filename) 
    161161        { 
    162                 throw new IOException (filename[0..$-1] ~ ": " ~ SysError.lastMsg); 
     162                exception (filename[0..$-1] ~ ": ", SysError.lastMsg); 
     163        } 
     164 
     165        /*********************************************************************** 
     166 
     167                Throw an IO exception  
     168 
     169        ***********************************************************************/ 
     170 
     171        static void exception (char[] prefix, char[] error) 
     172        { 
     173                throw new IOException (prefix ~ error); 
    163174        } 
    164175 
     
    904915 
    905916        Note that patterns of adjacent '.' separators are treated specially 
    906         in that they will be assigned to the name instead of the suffix. In 
    907         addition, a '.' at the start of a name signifies it does not belong 
    908         to the suffix i.e. ".file" is a name rather than a suffix. 
     917        in that they will be assigned to the name where there is no distinct 
     918        suffix. In addition, a '.' at the start of a name signifies it does  
     919        not belong to the suffix i.e. ".file" is a name rather than a suffix. 
     920        Patterns of intermediate '.' characters will otherwise be assigned 
     921        to the suffix, such that "file....suffix" includes the dots within 
     922        the suffix itself [see ext() for a suffix without dots]. 
    909923 
    910924        Note also that normalization of path-separators occurs by default.  
     
    918932        package char[]  fp;                     // filepath with trailing 
    919933        package int     end_,                   // before any trailing 0 
     934                        ext_,                   // after rightmost '.' 
    920935                        name_,                  // file/dir name 
    921936                        folder_,                // path before name 
    922                         suffix_;                // after rightmost '.' 
     937                        suffix_;                // including leftmost '.' 
    923938 
    924939        /*********************************************************************** 
     
    10281043                Ext is the tail of the filename, rightward of the rightmost 
    10291044                '.' separator e.g. path "foo.bar" has ext "bar". Note that 
    1030                 patterns of adjacent separators are treated specially; for 
     1045                patterns of adjacent separators are treated specially - for 
    10311046                example, ".." will wind up with no ext at all 
    10321047 
     
    10371052                auto x = suffix; 
    10381053                if (x.length) 
    1039                     x = x [1..$]; 
     1054                   { 
     1055                   if (ext_ is 0) 
     1056                       foreach (c; x) 
     1057                                if (c is '.') 
     1058                                    ++ext_; 
     1059                                else 
     1060                                   break; 
     1061                   x = x [ext_ .. $]; 
     1062                   } 
    10401063                return x; 
    10411064        } 
     
    11511174                                 break; 
    11521175 
     1176                            // Windows file separators are illegal. Use 
     1177                            // standard() or equivalent to convert first 
    11531178                            case '\\': 
    1154                                  throw new IOException ("unexpected '\\' character in path: "~path); 
     1179                                 FS.exception ("unexpected '\\' character in path: ", path); 
    11551180 
    11561181                            version (Win32) 
  • branches/experimental/D2.0/tango/io/TempFile.d

    r3886 r3887  
    1616import tango.io.DeviceConduit : DeviceConduit; 
    1717import tango.io.FileConduit : FileConduit; 
    18 import tango.io.FilePath : FilePath/*, PathView*/
     18import tango.io.FilePath : FilePath
    1919import tango.stdc.stringz : toStringz, toString16z; 
    2020 
     
    2424version( Win32 ) 
    2525{ 
    26     import tango.sys.Common : DWORD, LONG
     26    import tango.sys.Common : DWORD, LONG, MAX_PATH, PCHAR, CP_UTF8
    2727 
    2828    enum : DWORD { FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 } 
     
    3939            GetTempPathA, SetFilePointer, GetLastError, ERROR_SUCCESS; 
    4040 
    41         HANDLE CreateFile(FilePath fn, DWORD da, DWORD sm, 
     41        HANDLE CreateFile(char[] fn, DWORD da, DWORD sm, 
    4242                LPSECURITY_ATTRIBUTES sa, DWORD cd, DWORD faa, HANDLE tf) 
    4343        { 
    44             return CreateFileA(fn.cString.ptr, da, sm, sa, cd, faa, tf); 
     44            return CreateFileA(toStringz(fn), da, sm, sa, cd, faa, tf); 
    4545        } 
    4646 
     
    6161    { 
    6262        import tango.sys.Common : 
     63            MultiByteToWideChar, WideCharToMultiByte, 
    6364            GetVersionExW, OSVERSIONINFO, 
    6465            CreateFileW, GENERIC_READ, GENERIC_WRITE, 
     
    6970            GetTempPathW, SetFilePointer, GetLastError, ERROR_SUCCESS; 
    7071 
    71         import tango.text.convert.Utf : toString, toString16; 
    72  
    73         HANDLE CreateFile(FilePath fn, DWORD da, DWORD sm, 
     72        HANDLE CreateFile(char[] fn, DWORD da, DWORD sm, 
    7473                LPSECURITY_ATTRIBUTES sa, DWORD cd, DWORD faa, HANDLE tf) 
    7574        { 
    76             return CreateFileW(toString16(fn.cString).ptr, 
    77                     da, sm, sa, cd, faa, tf); 
     75                // convert into output buffer 
     76                wchar[MAX_PATH+1] tmp = void; 
     77                assert (fn.length < tmp.length); 
     78                auto i = MultiByteToWideChar (CP_UTF8, 0, cast(PCHAR) fn.ptr,  
     79                                              fn.length, tmp.ptr, tmp.length); 
     80                tmp[i] = 0; 
     81                return CreateFileW(tmp.ptr, da, sm, sa, cd, faa, tf); 
    7882        } 
    7983 
     
    8892            if( len == 0 ) 
    8993                throw new Exception("could not obtain temporary path"); 
    90             return Path.standard(toString(result[0..len])); 
     94 
     95            auto dir = new char [len * 3]; 
     96            auto i = WideCharToMultiByte (CP_UTF8, 0, result.ptr, len,  
     97                                          cast(PCHAR) dir.ptr, dir.length, null, null); 
     98            return Path.standard (dir[0..i]); 
    9199        } 
    92100    } 
     
    286294 
    287295    // Path to the temporary file 
    288     private /*PathView*/ FilePath _path; 
     296    private char[] _path; 
    289297 
    290298    // Style we've opened with 
     
    303311    this(char[] prefix, Style style = Style.init) 
    304312    { 
    305         this(FilePath(prefix), style); 
    306     } 
    307  
    308     /// 
    309     this(FilePath prefix, Style style = Style.init) 
    310     { 
    311         create(prefix.dup, style); 
     313        create (prefix, style); 
     314    } 
     315 
     316    /// deprecated: please use char[] version instead 
     317    deprecated this(FilePath prefix, Style style = Style.init) 
     318    { 
     319        this (prefix.toString.dup, style); 
    312320    } 
    313321 
     
    319327    /************************************************************************** 
    320328     * 
    321      * Returns a PathView to the temporary file.  Please note that depending 
     329     * Returns the path of the temporary file.  Please note that depending 
    322330     * on your platform, the returned path may or may not actually exist if 
    323331     * you specified a transient file. 
    324332     * 
    325333     **************************************************************************/ 
    326     /*PathView*/ FilePath path() 
     334    char[] path() 
    327335    { 
    328336        return _path; 
     
    341349    override char[] toString() 
    342350    { 
    343         if( path.toString.length > 0 ) 
    344             return path.toString
     351        if( path.length > 0 ) 
     352            return path
    345353        else 
    346354            return "<TempFile>"; 
     
    379387    } 
    380388 
    381     private void create(FilePath prefix, Style style) 
     389    private void create(char[] prefix, Style style) 
    382390    { 
    383391        for( size_t i=0; i<style.attempts; ++i ) 
    384392        { 
    385             if( create_path(prefix.dup.append(randomName), style) ) 
     393            if( create_path(Path.join(prefix, randomName), style) ) 
    386394                return; 
    387395        } 
     
    402410         * Returns the path to the temporary directory. 
    403411         */ 
    404         public static FilePath tempPath() 
    405         { 
    406             return FilePath(GetTempPath()).dup
     412        public static char[] tempPath() 
     413        { 
     414            return GetTempPath
    407415        } 
    408416 
     
    411419         * style. 
    412420         */ 
    413         private bool create_path(FilePath path, Style style) 
     421        private bool create_path(char[] path, Style style) 
    414422        { 
    415423            // TODO: Check permissions directly and throw an exception; 
     
    480488         * Returns the path to the temporary directory. 
    481489         */ 
    482         public static FilePath tempPath() 
     490        public static char[] tempPath() 
    483491        { 
    484492            // Check for TMPDIR; failing that, use /tmp 
    485493            if( auto tmpdir = Environment.get("TMPDIR") ) 
    486                 return FilePath(tmpdir).dup; 
     494                return tmpdir.dup; 
    487495            else 
    488                 return FilePath("/tmp/").dup
     496                return "/tmp/"
    489497        } 
    490498 
     
    493501         * style. 
    494502         */ 
    495         private bool create_path(FilePath path, Style style) 
     503        private bool create_path(char[] path, Style style) 
    496504        { 
    497505            // Check suitability 
    498506            { 
    499                 auto parent = path.path; 
     507                auto parent = Path.parse(path).path; 
    500508                auto parentz = toStringz(parent); 
    501509 
     
    528536                    | O_NOFOLLOW | O_RDWR; 
    529537 
    530                 auto pathz = path.cString.ptr
     538                auto pathz = toStringz(path)
    531539 
    532540                handle = open(pathz, flags, 0600); 
     
    579587         * 
    580588         **********************************************************************/ 
    581         FilePath tempPath(); 
     589        char[] tempPath(); 
    582590    } 
    583591    else 
  • branches/experimental/D2.0/tango/io/ThreadConduit.d

    r3724 r3887  
    1313private import tango.core.Exception; 
    1414 
    15 public import tango.io.model.IConduit; 
     15public import tango.io.Conduit; 
    1616 
    1717/** 
     
    3636 * t.join(); 
    3737 */ 
    38 class ThreadConduit : IConduit 
     38class ThreadConduit : Conduit 
    3939{ 
    4040    private bool _closed; 
     
    6060 
    6161    /** 
    62      * Implements IConduit.input (covariant) 
    63      */ 
    64     ThreadConduit input() 
    65     { 
    66         return this; 
    67     } 
    68  
    69     /** 
    70      * Implements IConduit.output (covariant) 
    71      */ 
    72     ThreadConduit output() 
    73     { 
    74         return this; 
    75     } 
    76  
    77     /** 
    7862     * Implements IConduit.bufferSize 
    7963     * 
     
    9175     * Implements IConduit.toString 
    9276     * 
    93      * Returns "<thread conduit>
     77     * Returns "&lt;thread conduit&gt;
    9478     */ 
    9579    char[] toString() 
     
    10286     * closed. 
    10387     */ 
    104     bool isAlive() 
     88    override bool isAlive() 
    10589    { 
    10690        synchronized(_mutex) 
     
    152136            _condition.notifyAll(); 
    153137        } 
    154     } 
    155  
    156     /** 
    157      * Throw an IOException with the given message. 
    158      */ 
    159     void error(char[] msg) 
    160     { 
    161         throw new IOException(msg); 
    162     } 
    163  
    164     /** 
    165      * Implements InputStream.conduit and OutputStream.conduit (covariant) 
    166      */ 
    167     ThreadConduit conduit() 
    168     { 
    169         return this; 
    170     } 
    171  
    172     /** 
    173      * Close the write end of the conduit.  Same as detach() 
    174      */ 
    175     void close() 
    176     { 
    177         detach(); 
    178138    } 
    179139 
     
    230190            return result; 
    231191        } 
    232     } 
    233  
    234     /** 
    235      * Implements InputStream.load 
    236      * 
    237      * Load the bits from a stream, and return them all in an array. The dst 
    238      * array can be provided as an option, which will be expanded as necessary 
    239      * to consume the input. 
    240      * 
    241      * Returns an array representing the content, and throws IOException on 
    242      * error 
    243      */ 
    244     void[] load(void[] dst = null) 
    245     { 
    246         // 
    247         // copied from Conduit.load 
    248         // 
    249         auto chunk = 0; 
    250         auto index = 0; 
    251  
    252         while (chunk != Eof) 
    253         { 
    254             if (dst.length - index < 1024) 
    255                 dst.length = dst.length + 16 * 1024; 
    256  
    257             chunk = read (dst[index .. $]); 
    258             index += chunk; 
    259         }  
    260  
    261         return dst [0 .. index - chunk]; 
    262192    } 
    263193 
     
    325255        } 
    326256    } 
    327  
    328     /** 
    329      * Implements OutputStream.copy 
    330      * 
    331      * Transfer the content of another stream to this one. Returns a reference 
    332      * to this class, and throws IOException on failure. 
    333      */ 
    334     ThreadConduit copy(InputStream src) 
    335     { 
    336         // 
    337         // copied from Conduit 
    338         // 
    339         uint len = 0; 
    340         auto tmp = new void [bufferSize]; 
    341         while ((len = src.read(tmp)) != IConduit.Eof) 
    342         { 
    343             auto p = tmp.ptr; 
    344             for (uint j; len > 0; len -= j, p += j) 
    345                 if ((j = write (p[0..len])) is IConduit.Eof) 
    346                     error ("ThreadConduit.copy :: Eof while writing to: "~toString); 
    347         } 
    348         delete tmp; 
    349         return this; 
    350     } 
    351  
    352     /** 
    353      * Implements OutputStream.flush 
    354      * 
    355      * Since there is no callable sink, this is a noop. 
    356      */ 
    357     ThreadConduit flush() 
    358     { 
    359         return this; 
    360     } 
    361257} 
  • branches/experimental/D2.0/tango/io/compress/Zip.d

    r3886 r3887  
    15221522        with( info ) 
    15231523        { 
    1524             name = header.file_name.dup
     1524            name = Path.standard(header.file_name.dup)
    15251525            dosToTime(header.data.modification_file_time, 
    15261526                      header.data.modification_file_date, 
  • branches/experimental/D2.0/tango/io/digest/Crc32.d

    r2810 r3887  
    4747                        for (int j = 8; j > 0; j--) 
    4848                        { 
     49                                version (Gim) 
     50                                { 
     51                                if (value & 1)  
     52                                   { 
     53                                   value >>>= 1; 
     54                                   value ^= polynomial; 
     55                                   } 
     56                                else 
     57                                   value >>>= 1; 
     58                                } 
     59                                else 
     60                                { 
    4961                                if (value & 1) { 
    5062                                        value &= 0xFFFFFFFE; 
     
    5971                                        value &= 0x7FFFFFFF; 
    6072                                } 
     73                                } 
    6174                        } 
    6275                        table[i] = value; 
     
    6578 
    6679        /** */ 
    67         override void update (void[] input) 
     80        override Crc32 update (void[] input) 
    6881        { 
    6982                uint r = result; // DMD optimization 
     
    7285                        auto i = cast(ubyte) r;// & 0xff; 
    7386                        i ^= value; 
     87                        version (Gim) 
     88                        { 
     89                        r >>>= 8; 
     90                        } 
     91                        else 
     92              &n