spunQ_FileNode Class Reference

Class representing an object in the file system. More...

Inheritance diagram for spunQ_FileNode:

spunQ_IFileNode spunQ_File spunQ_Folder spunQ_ArchiveFile spunQ_GzipFile spunQ_SectionedConfigFile spunQ_SourceFolder spunQ_ZipFile

List of all members.

Public Member Functions

 __construct ($path)
 Constructor.
 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.
 __toString ()
 Returns getPrettyPath().

Static Public Member Functions

static pathIsAbsolute ($filePath)
 Tests if a givebn file path is absolute or relative.
static prettifyPath ($path)
 Makes transformations to a path string to make it more readable.

Protected Attributes

 $path
 The path pointing to the node.


Detailed Description

Class representing an object in the file system.

Possible sub-classes include file, folder, named pipe, device node, etc.

Definition at line 7 of file FileNode.class.php.


Constructor & Destructor Documentation

spunQ_FileNode::__construct ( path  ) 

Constructor.

Parameters:
$path The path pointing to the node.

Definition at line 70 of file FileNode.class.php.


Member Function Documentation

spunQ_FileNode::__toString (  ) 

Returns getPrettyPath().

Returns:
string

Definition at line 162 of file FileNode.class.php.

spunQ_FileNode::exists (  ) 

Whether this node already exists in the file system.

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

Returns:
bool

Implements spunQ_IFileNode.

Definition at line 78 of file FileNode.class.php.

spunQ_FileNode::getContainingFolder (  ) 

Returns the folder this node is residing in.

Returns:
spunQ_IFolder

Implements spunQ_IFileNode.

Definition at line 127 of file FileNode.class.php.

spunQ_FileNode::getLastAccessTime (  ) 

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.

Implements spunQ_IFileNode.

Definition at line 141 of file FileNode.class.php.

spunQ_FileNode::getLastModificationTime (  ) 

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.

Implements spunQ_IFileNode.

Definition at line 151 of file FileNode.class.php.

spunQ_FileNode::getName (  ) 

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

Returns:
string

Implements spunQ_IFileNode.

Definition at line 134 of file FileNode.class.php.

spunQ_FileNode::getPath (  ) 

Returns the path pointing to the node.

Returns:
string

Implements spunQ_IFileNode.

Definition at line 102 of file FileNode.class.php.

spunQ_FileNode::getPrettyPath (  ) 

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

Implements spunQ_IFileNode.

Definition at line 109 of file FileNode.class.php.

spunQ_FileNode::isReadable (  ) 

Whether the node is readable.

Returns:
bool

Implements spunQ_IFileNode.

Definition at line 95 of file FileNode.class.php.

static spunQ_FileNode::pathIsAbsolute ( filePath  )  [static]

Tests if a givebn file path is absolute or relative.

Parameters:
$filePath The file path - a string.
Returns:
boolean

Definition at line 14 of file FileNode.class.php.

static spunQ_FileNode::prettifyPath ( path  )  [static]

Makes transformations to a path string to make it more readable.

Removes references to current and upper directories (/foo/.. or foo/.), for example. Assumes that the path has a slash as delimiter. if you want to use this function on a windows path, make sure to replace backslashes by forward slashes beforehand.

Parameters:
$path The path string to transform.
Returns:
string

Definition at line 34 of file FileNode.class.php.

spunQ_FileNode::residesIn ( spunQ_IFolder folder  ) 

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

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

Implements spunQ_IFileNode.

Definition at line 85 of file FileNode.class.php.


Member Data Documentation

spunQ_FileNode::$path [protected]

The path pointing to the node.

string

Definition at line 64 of file FileNode.class.php.


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

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