Class Swift_File

Description

Swift File stream abstraction layer

Reads bytes from a file

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


	
			
Variable Summary
resource $handle
boolean $magic_quotes
string $name
string $path
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, [ $unquote = true])
string readFull ()
string readln ()
void reset ()
void setPath (string $path)
Variables
resource $handle = null (line 37)

The resource returned by fopen() against the path

  • access: protected
boolean $magic_quotes = false (line 42)

The status of magic_quotes in php.ini

  • access: protected
string $name = null (line 32)

The name of the file

  • access: protected
string $path = null (line 27)

The accessible path to the file

  • access: protected
Methods
Constructor __construct (line 49)

Constructor

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

Destructor

Closes the file

  • access: public
void __destruct ()
close (line 193)

Close the open handle on the file

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

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

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

Check if the pointer as at the end of the file

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

Get a single byte from the file

Returns false past EOF

  • access: public
  • 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

  • access: public
string getFileName ()
getPath (line 74)

Get the path to the file

  • access: public
string getPath ()
length (line 185)

Get the size of the file in bytes

  • access: public
int length ()
read (line 167)

Read a given number of bytes from the file

Returns false past EOF

  • access: public
  • throws: Swift_FileException If the file cannot be read
string read ( $bytes, [ $unquote = true])
  • $bytes
  • $unquote
readFull (line 153)

Get the entire file contents as a string

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

Read one full line from the file including the line ending

Returns false past EOF

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

Reset the file pointer back to zero

  • access: public
void reset ()
setPath (line 59)

Set the path to the file

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

Documentation generated on Wed, 26 Mar 2008 20:33:07 +1100 by phpDocumentor 1.3.1