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

Changeset 3640

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

FileConduit? updates. FilePath? usage is being deprecated at this level

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/conduits/FileBucket.d

    r2913 r3640  
    11module FileBucket; 
    22 
    3 private import  tango.io.FilePath, 
    4                 tango.io.FileConduit; 
     3private import  tango.io.FileConduit; 
    54 
    65private import  tango.core.Exception; 
     
    5655 
    5756        // basic capacity for each record 
    58         private FilePath                path; 
     57        private char[]                  path; 
    5958 
    6059        // basic capacity for each record 
     
    8786        /********************************************************************** 
    8887 
    89                 Construct a FileBucket with the provided path and record- 
    90                 size. Selecting a record size that roughly matches the  
    91                 serialized content will limit 'thrashing'. 
    92  
    93         **********************************************************************/ 
    94  
    95         this (char[] path, BlockSize block) 
    96         { 
    97                 this (new FilePath(path), block); 
    98         } 
    99  
    100         /********************************************************************** 
    101  
    10288                Construct a FileBucket with the provided path, record-size, 
    10389                and inital record count. The latter causes records to be  
     
    10894        **********************************************************************/ 
    10995 
    110         this (FilePath path, BlockSize block, uint initialRecords = 100) 
     96        this (char[] path, BlockSize block, uint initialRecords = 100) 
    11197        { 
    11298                this.path = path; 
     
    139125        **********************************************************************/ 
    140126 
    141         FilePath getFilePath () 
     127        char[] getFilePath () 
    142128        { 
    143129                return path; 
     
    250236                private static void eof (FileBucket bucket) 
    251237                { 
    252                         throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path.toString()~"'"); 
     238                        throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path~"'"); 
    253239                } 
    254240 
  • trunk/install/snapshot/srcsnapshot.d

    r3547 r3640  
    6161 
    6262    auto props = new Properties!(char); 
    63     props.load(new FilePath(args[1]), &configReader); 
     63    props.load(args[1], &configReader); 
    6464 
    6565 
  • trunk/tango/io/File.d

    r3625 r3640  
    3737class File 
    3838{ 
    39         private PathView path_; 
     39        private char[] path_; 
    4040 
    4141        /*********************************************************************** 
     
    4747        this (char[] path) 
    4848        { 
    49                 this (new FilePath (path))
     49                path_ = path
    5050        } 
    5151 
     
    5656        ***********************************************************************/ 
    5757                                   
    58         this (PathView path) 
     58        deprecated this (PathView path) 
    5959        { 
    60                 path_ = path
     60                this(path.toString)
    6161        } 
    6262 
     
    8080        ***********************************************************************/ 
    8181 
    82         final PathView path () 
     82        deprecated final PathView path () 
    8383        { 
    84                 return path_
     84                return new FilePath(path_)
    8585        } 
    8686 
  • trunk/tango/io/UnicodeFile.d

    r2765 r3640  
    1313module tango.io.UnicodeFile; 
    1414 
    15 public import  tango.io.FilePath; 
     15private import  tango.io.FilePath; 
    1616 
    1717private import  tango.io.FileConduit; 
     
    102102{ 
    103103        private UnicodeBom!(T)  bom; 
    104         private PathView        path_; 
     104        private char[]          path_; 
    105105 
    106106        /*********************************************************************** 
     
    112112        ***********************************************************************/ 
    113113                                   
    114         this (PathView path, Encoding encoding) 
     114        this (char[] path, Encoding encoding) 
    115115        { 
    116116                bom = new UnicodeBom!(T)(encoding); 
     
    126126        ***********************************************************************/ 
    127127 
    128         this (char[] path, Encoding encoding) 
    129         { 
    130                 this (new FilePath(path), encoding); 
     128        this (FilePath path, Encoding encoding) 
     129        { 
     130                this (path.toString, encoding); 
    131131        } 
    132132 
     
    150150        ***********************************************************************/ 
    151151 
    152         PathView path () 
     152        deprecated PathView path () 
     153        { 
     154                return new FilePath (path_); 
     155        } 
     156         
     157        /*********************************************************************** 
     158 
     159                Return the associated file path 
     160 
     161        ***********************************************************************/ 
     162 
     163        char[] toString () 
    153164        { 
    154165                return path_; 
  • trunk/tango/net/cluster/tina/QueueFile.d

    r3485 r3640  
    8989                        } 
    9090 
    91                 auto length = conduit.path.fileSize
     91                auto length = conduit.length
    9292                if (length is 0) 
    9393                   { 
  • trunk/tango/text/Properties.d

    r3547 r3640  
    3939        ***********************************************************************/ 
    4040 
    41         static void load (FilePath path, void delegate (T[] name, T[] value) dg) 
     41        deprecated static void load (FilePath path, void delegate (T[] name, T[] value) dg) 
     42        { 
     43                load (path.toString, dg); 
     44        } 
     45 
     46        /*********************************************************************** 
     47 
     48                Load properties from the named file, and pass each of them 
     49                to the provided delegate. 
     50 
     51        ***********************************************************************/ 
     52 
     53        static void load (char[] path, void delegate (T[] name, T[] value) dg) 
    4254        { 
    4355                auto fc = new FileConduit (path); 
     
    92104        ***********************************************************************/ 
    93105 
    94         static void save (FilePath path, T[][T[]] properties) 
     106        deprecated static void save (FilePath path, T[][T[]] properties) 
     107        { 
     108                save (path.toString, properties); 
     109        } 
     110 
     111        /*********************************************************************** 
     112 
     113                Write properties to the provided filepath 
     114 
     115        ***********************************************************************/ 
     116 
     117        static void save (char[] path, T[][T[]] properties) 
    95118        { 
    96119                auto fc = new FileConduit (path, FileConduit.WriteCreate); 
  • trunk/tango/util/log/AppendFile.d

    r3547 r3640  
    4040        ***********************************************************************/ 
    4141 
    42         this (FilePath fp, Appender.Layout how = null) 
     42        this (char[] fp, Appender.Layout how = null) 
    4343        { 
    4444                // Get a unique fingerprint for this instance 
    45                 mask_ = register (fp.toString); 
     45                mask_ = register (fp); 
    4646         
    4747                // make it shareable for read 
     
    5959        ***********************************************************************/ 
    6060 
    61         this (char[] fp, Appender.Layout how = null) 
     61        deprecated this (FilePath fp, Appender.Layout how = null) 
    6262        { 
    63                 this (new FilePath(fp), how); 
     63                this (fp.toString, how); 
    6464        } 
    6565 
  • trunk/tango/util/log/AppendFiles.d

    r3547 r3640  
    1515private import  tango.time.Time; 
    1616 
    17 private import  tango.io.FilePath, 
     17private import  Path = tango.io.Path, 
    1818                tango.io.FileConduit; 
    1919 
     
    3333{ 
    3434        private Mask            mask_; 
    35         private FilePath[]      paths; 
     35        private char[][]        paths; 
    3636        private int             index; 
    3737        private IBuffer         buffer; 
     
    6363                    { 
    6464                    x[0] = '0' + i; 
    65  
    66                     auto p = new FilePath (path); 
    67                     p.name = p.name ~ x; 
     65                    auto c = Path.parse (path); 
     66                    auto p = c.toString[0..$-c.suffix.length] ~ x ~ c.suffix; 
    6867                    paths ~= p; 
    6968 
    7069                    // use the most recent file in the set 
    71                     if (p.exists
     70                    if (Path.exists(p)
    7271                       { 
    73                        auto modified = p.modified
     72                       auto modified = Path.modified(p)
    7473                       if (modified > mostRecent) 
    7574                          {