Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

File Class Reference

Inheritance diagram for File:

FileProxy List of all members.

Public Member Functions

 this (char[] path)
 this (FilePath path)
void[] read ()
File write (void[] content)
File append (void[] content)

Private Member Functions

File write (void[] content, FileStyle style)
FilePath getPath ()
char[] toString ()
bool isExisting ()
FilePath[] toList ()
void write (IWriter emit)

Detailed Description

A wrapper atop of FileConduit to expose a simpler API. This one return the entire file content as a void[], and sets the content to reflect a given void[].

Method read() returns the current content of the file, whilst write() sets the file content, and file length, to the provided array. Method append() adds content to the tail of the file.

Methods to inspect the file system, check the status of a file or directory, and other facilities are made available via the FileProxy superclass.

Definition at line 62 of file File.d.


Member Function Documentation

this char[]  path  )  [inline]
 

Construct a File from a text string

Reimplemented from FileProxy.

Definition at line 70 of file File.d.

this FilePath  path  )  [inline]
 

Construct a File from the provided FilePath

Reimplemented from FileProxy.

Definition at line 81 of file File.d.

void [] read  )  [inline]
 

Return the content of the file.

Definition at line 92 of file File.d.

References FileConduit, and FileConduit::length().

File write void[]  content  )  [inline]
 

Set the file content and length to reflect the given array.

Definition at line 110 of file File.d.

Referenced by append().

File append void[]  content  )  [inline]
 

Append content to the file.

Definition at line 121 of file File.d.

References write().

File write void[]  content,
FileStyle  style
[inline, private]
 

Set the file content and length to reflect the given array.

Definition at line 132 of file File.d.

References FileConduit.

FilePath getPath  )  [inline, inherited]
 

Return the FilePath associated with this FileProxy

Definition at line 153 of file FileProxy.d.

References FileProxy::path.

Referenced by testFileSize(), and testScanFiles().

char [] toString  )  [inline, inherited]
 

Return the name of the associated path

Definition at line 164 of file FileProxy.d.

References FileProxy::path, and FilePath::toString().

bool isExisting  )  [inline, inherited]
 

Does this path currently exist?

Definition at line 175 of file FileProxy.d.

FilePath [] toList  )  [inline, inherited]
 

List the files contained within the associated path:

                FileProxy proxy = new FileProxy (".");

                foreach (FilePath path; proxy.toList())
                         Stdout.put(path).cr();

Definition at line 197 of file FileProxy.d.

Referenced by FileScan::scanFiles(), testFileList(), and testScanFiles().

void write IWriter  emit  )  [inline, inherited]
 

Write this FileProxy to the given IWriter. We just emit the filepath, since that's what we represent.

Reimplemented from IWritable.

Definition at line 211 of file FileProxy.d.

References FileProxy::path.


The documentation for this class was generated from the following file:
Generated on Fri May 27 18:12:00 2005 for Mango by  doxygen 1.4.0