spunQ_IFile Interface Reference

Allows access to files. More...

Inheritance diagram for spunQ_IFile:

spunQ_IFileNode spunQ_File spunQ_ArchiveFile spunQ_GzipFile spunQ_SectionedConfigFile spunQ_ZipFile

List of all members.

Public Member Functions

 getFolder ()
 Alias for getContainingFolder().
 getExtension ()
 Gets the extension of this file.
 create ()
 Makes sure this file actually exists.
 delete ()
 Deletes this file from the file system.
 rename ($newName, $overwrite)
 Renames the file, but keeps it in the same folder.
 copyTo ($file, $overwrite)
 Copies the contents of this file into another file.
 moveTo ($folder, $overwrite, $newName=NULL)
 Moves this file into another directory (and optionally renames it).
 readIntoArray ()
 Reads the contents of this file into an array, where every line is an element.
 readIntoString ()
 Reads the contents of this file into a string.
 getFileName ()
 Gets the name of this file, up to the first dot.
 assureExists ()
 Throws an exception if this file does not exist.
 write ($string, $append)
 Writes the content of the given string into the file.
 getSize ()
 Gets this file's size in bytes.
 exists ()
 Whether this node already exists in the file system.
 residesIn (spunQ_IFolder $folder)
 Checks whether this file is in given folder or one of its subfolders.
 isReadable ()
 Whether the node is readable.
 getPath ()
 Returns the path pointing to the node.
 getPrettyPath ()
 Returns the most unique and human-readable path.
 getContainingFolder ()
 Returns the folder this node is residing in.
 getName ()
 Returns the name of this node, deprived of its path.
 getLastAccessTime ()
 Returns the time of last access of this node.
 getLastModificationTime ()
 Returns the time of last modification of this node.


Detailed Description

Allows access to files.

Definition at line 6 of file IFile.interface.php.


Member Function Documentation

spunQ_IFile::assureExists (  ) 

Throws an exception if this file does not exist.

Returns:
spunQ_IFile $this
Exceptions:
spunQ_IOException 

Implemented in spunQ_File.

spunQ_IFile::copyTo ( file,
overwrite 
)

Copies the contents of this file into another file.

Parameters:
$file The file to copy to. Either a spunQ_IFile object or a string.
$overwrite Whether the destination file should be overwritten.
Returns:
spunQ_IFile $this

Implemented in spunQ_File.

spunQ_IFile::create (  ) 

Makes sure this file actually exists.

Doesn't do anything, if the node already exists.

Returns:
spunQ_IFile $this

Implemented in spunQ_File.

spunQ_IFile::delete (  ) 

Deletes this file from the file system.

Returns:
spunQ_IFile $this

Implemented in spunQ_File.

spunQ_IFileNode::exists (  )  [inherited]

Whether this node already exists in the file system.

It is perfectly valid for an object to describe a non-existent node.

Returns:
bool

Implemented in spunQ_FileNode.

spunQ_IFileNode::getContainingFolder (  )  [inherited]

Returns the folder this node is residing in.

Returns:
spunQ_IFolder

Implemented in spunQ_FileNode.

spunQ_IFile::getExtension (  ) 

Gets the extension of this file.

Extension is defined as the last part of the file that is seperated by a dot. The extension of the file 'Some.class.php' is 'php'.

Returns:
string

Implemented in spunQ_File.

spunQ_IFile::getFileName (  ) 

Gets the name of this file, up to the first dot.

The FileName of 'Some.class.php' is 'Some'.

Returns:
string

Implemented in spunQ_File.

spunQ_IFile::getFolder (  ) 

Alias for getContainingFolder().

Returns:
spunQ_IFolder

Implemented in spunQ_File.

spunQ_IFileNode::getLastAccessTime (  )  [inherited]

Returns the time of last access of this node.

Returns:
int The result is a unix-timestamp
Exceptions:
spunQ_IOException If the timestamp could not be read.

Implemented in spunQ_FileNode.

spunQ_IFileNode::getLastModificationTime (  )  [inherited]

Returns the time of last modification of this node.

Returns:
int The result is a unix-timestamp
Exceptions:
spunQ_IOException If the timestamp could not be read.

Implemented in spunQ_FileNode.

spunQ_IFileNode::getName (  )  [inherited]

Returns the name of this node, deprived of its path.

Returns:
string

Implemented in spunQ_FileNode.

spunQ_IFileNode::getPath (  )  [inherited]

Returns the path pointing to the node.

Returns:
string

Implemented in spunQ_FileNode.

spunQ_IFileNode::getPrettyPath (  )  [inherited]

Returns the most unique and human-readable path.

If the file exists, the builtin function realpath() is used. Otherwise, a better-looking path is achieved through string manipulation, i.e. '../a/../d/./' becomes '../d/'.

Returns:
string

Implemented in spunQ_FileNode.

spunQ_IFile::getSize (  ) 

Gets this file's size in bytes.

Returns:
integer
Exceptions:
spunQ_IOException 

Implemented in spunQ_File.

spunQ_IFileNode::isReadable (  )  [inherited]

Whether the node is readable.

Returns:
bool

Implemented in spunQ_FileNode.

spunQ_IFile::moveTo ( folder,
overwrite,
newName = NULL 
)

Moves this file into another directory (and optionally renames it).

Parameters:
$folder the folder to move to. Either a spunQ_IFolder or a string.
$overwrite Whether the destination file should be overwritten.
$newName The file will be renamed, too if this is set.
Returns:
spunQ_IFile $this

Implemented in spunQ_File.

spunQ_IFile::readIntoArray (  ) 

Reads the contents of this file into an array, where every line is an element.

Returns:
array

Implemented in spunQ_File, and spunQ_GzipFile.

spunQ_IFile::readIntoString (  ) 

Reads the contents of this file into a string.

Returns:
string

Implemented in spunQ_File, and spunQ_GzipFile.

spunQ_IFile::rename ( newName,
overwrite 
)

Renames the file, but keeps it in the same folder.

Use moveTo() if you want to rename and move.

Parameters:
$newName The new name of the file.
$overwrite Whether the destination file should be overwritten.
Returns:
spunQ_IFile $this

Implemented in spunQ_File.

spunQ_IFileNode::residesIn ( spunQ_IFolder folder  )  [inherited]

Checks whether this file is in given folder or one of its subfolders.

Parameters:
$folder The folder to test against.
Returns:
bool

Implemented in spunQ_FileNode.

spunQ_IFile::write ( string,
append 
)

Writes the content of the given string into the file.

Parameters:
$string The string to write
$append Whether to append to the exiosting file, or replace its content.
Returns:
spunQ_IFile $this
Exceptions:
spunQ_IOException 

Implemented in spunQ_File, and spunQ_GzipFile.


The documentation for this interface was generated from the following file:

Generated on Fri Jul 1 11:12:41 2011 for spunQ3 by  doxygen 1.5.9