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.Bits 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 returns 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 63 of file File.d.


Member Function Documentation

this char[]  path  )  [inline]
 

Construct a File from a text string

Reimplemented from FileProxy.

Definition at line 71 of file File.d.

this FilePath  path  )  [inline]
 

Construct a File from the provided FilePath

Reimplemented from FileProxy.

Definition at line 82 of file File.d.

void [] read  )  [inline]
 

Return the content of the file.

Definition at line 93 of file File.d.

References FileConduit.

File write void[]  content  )  [inline]
 

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

Definition at line 115 of file File.d.

Referenced by append().

File append void[]  content  )  [inline]
 

Append content to the file.

Definition at line 126 of file File.d.

References write().

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

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

Definition at line 137 of file File.d.

References FileConduit.

FilePath getPath  )  [inline, inherited]
 

Return the FilePath associated with this FileProxy

Definition at line 152 of file FileProxy.d.

References FileProxy::path.

char [] toString  )  [inline, inherited]
 

Return the name of the associated path

Definition at line 163 of file FileProxy.d.

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

bool isExisting  )  [inline, inherited]
 

Does this path currently exist?

Definition at line 174 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 196 of file FileProxy.d.

Referenced by FileScan::scanFiles().

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 209 of file FileProxy.d.

References FileProxy::path.

Referenced by UnicodeFile(), and UnicodeFileTemplate().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:38 2005 for Mango by  doxygen 1.4.0