Class Swift_File

Description

Swift File stream abstraction layer

Reads bytes from a file

Located in /Swift/File.php (line 21)


	
			
Method Summary
Swift_File __construct (string $path)
void __destruct ()
void close ()
void createHandle ()
boolean EOF ()
string getByte ()
string getFileName ()
string getPath ()
int length ()
string read ( $bytes)
string readFull ()
string readln ()
void reset ()
void setPath (string $path)
Methods
Constructor __construct (line 49)

Constructor

  • throws: Swift_FileException If the file cannot be found
Swift_File __construct (string $path)
  • string $path: The path the the file
Destructor __destruct (line 206)

Destructor

Closes the file

void __destruct ()
close (line 188)

Close the open handle on the file

  • throws: Swift_FileException If the file cannot be read
void close ()
createHandle (line 98)

Establish an open file handle on the file if the file is not yet opened

  • throws: Swift_FileException If the file cannot be opened for reading
void createHandle ()
EOF (line 113)

Check if the pointer as at the end of the file

  • throws: Swift_FileException If the file cannot be read
boolean EOF ()
getByte (line 124)

Get a single byte from the file

Returns false past EOF

  • throws: Swift_FileException If the file cannot be read
string getByte ()
getFileName (line 82)

Get the name of the file without it's full path

string getFileName ()
getPath (line 74)

Get the path to the file

string getPath ()
length (line 180)

Get the size of the file in bytes

int length ()
read (line 164)

Read a given number of bytes from the file

Returns false past EOF

  • throws: Swift_FileException If the file cannot be read
string read ( $bytes)
  • $bytes
readFull (line 152)

Get the entire file contents as a string

  • throws: Swift_FileException If the file cannot be read
string readFull ()
readln (line 135)

Read one full line from the file including the line ending

Returns false past EOF

  • throws: Swift_FileException If the file cannot be read
string readln ()
reset (line 197)

Reset the file pointer back to zero

void reset ()
setPath (line 59)

Set the path to the file

  • throws: Swift_FileException If the file cannot be found
void setPath (string $path)
  • string $path: The path to the file

Documentation generated on Tue, 06 Mar 2007 23:32:24 +0000 by phpDocumentor 1.3.1