XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
FileObject Class Reference
Inheritance diagram for FileObject:
BaseObject

Public Member Functions

 __construct ($path, $mode)
 
 append ($file_name)
 
 feof ()
 
 read ($size=1024)
 
 write ($str)
 
 open ($path, $mode)
 
 getPath ()
 
 close ()
 
- Public Member Functions inherited from BaseObject
 __construct ($error=0, $message= 'success')
 
 setError ($error=0)
 
 getError ()
 
 setHttpStatusCode ($code= '200')
 
 getHttpStatusCode ()
 
 setMessage ($message= 'success', $type=NULL)
 
 getMessage ()
 
 add ($key, $val)
 
 adds ($object)
 
 get ($key)
 
 gets ()
 
 getVariables ()
 
 getObjectVars ()
 
 toBool ()
 
 toBoolean ()
 

Public Attributes

 $fp = NULL
 
 $path = NULL
 
 $mode = "r"
 
- Public Attributes inherited from BaseObject
 $error = 0
 
 $message = 'success'
 
 $variables = array()
 
 $httpStatusCode = NULL
 

Detailed Description

File abstraction class

Author
NAVER (devel.nosp@m.oper.nosp@m.s@xpr.nosp@m.esse.nosp@m.ngine.nosp@m..com)

Definition at line 9 of file FileObject.class.php.

Constructor & Destructor Documentation

FileObject::__construct (   $path,
  $mode 
)

Constructor

Parameters
string$pathPath of target file
string$modeFile open mode
Returns
void

Definition at line 37 of file FileObject.class.php.

Member Function Documentation

FileObject::append (   $file_name)

Append target file's content to current file

Parameters
string$file_namePath of target file
Returns
void

Definition at line 51 of file FileObject.class.php.

FileObject::close ( )

Close file

Returns
void

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

FileObject::feof ( )

Check current file meets eof

Returns
bool true: if eof. false: otherwise

Definition at line 67 of file FileObject.class.php.

FileObject::getPath ( )

Return current file's path

Returns
string Returns the path of current file.

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

FileObject::open (   $path,
  $mode 
)

Open a file

If file is opened, close it and open the new path

Parameters
string$pathPath of target file
string$modeFile open mode (http://php.net/manual/en/function.fopen.php)
Returns
bool true if succeed, false otherwise.

Definition at line 113 of file FileObject.class.php.

FileObject::read (   $size = 1024)

Read from current file

Parameters
int$sizeSize to read
Returns
string Returns the read string or false on failure.

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

FileObject::write (   $str)

Write string to current file

Parameters
string$strString to write
Returns
int Returns the number of bytes written, or false on error.

Definition at line 89 of file FileObject.class.php.

Member Data Documentation

FileObject::$fp = NULL

Definition at line 16 of file FileObject.class.php.

FileObject::$mode = "r"

Definition at line 28 of file FileObject.class.php.

FileObject::$path = NULL

Definition at line 22 of file FileObject.class.php.


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