Class inputfile

Description

The inputfile class manages files for input. It opens, reads and closes files in input-only mode.

Located in /file-defs.php (line 158)


	
			
Direct descendents
Class Description
 class csv_inputfile CSV Inputfile class Manage CSV-formatted files for input.
 class stylesheet Open a file which contains a stylesheet and read in the style settings. This is a special case of inputfile.
Variable Summary
 mixed $content
 mixed $datafname
 mixed $dir
 mixed $filesize
 mixed $fp
 mixed $name
 mixed $opened
Method Summary
 boolean inputfile (string $name, [string $dir = ""])
 void closefile ()
 void eof ()
 boolean readall ()
 mixed readln ([integer $maxchars = 4096])
Variables
mixed $content = "" (line 171)

Content of file after readall()

mixed $datafname = "" (line 165)

The full path to the file

mixed $dir = "" (line 163)

The directory prefix (if any) of the file

mixed $filesize = 0 (line 169)

Size of opened file in bytes

mixed $fp (line 175)

The file pointer

mixed $name = "" (line 161)

The file name

mixed $opened = false (line 167)

True if file was opened

Methods
Constructor inputfile (line 184)

Constructor Open the given file for input.

  • return: True if file was opened, else false
boolean inputfile (string $name, [string $dir = ""])
  • string $name: The name of the file
  • string $dir: The directory the file is in
closefile (line 248)

Close the file

void closefile ()
eof (line 239)

Return true if at end-of-file or not opened, else false

void eof ()
readall (line 217)

Reads all of the file contents into class variable $content.

  • return: True if the content was successfully read
boolean readall ()
readln (line 230)

Reads the next line of the file, up to max chars specified.

  • return: A string containing the line, or false if failed
mixed readln ([integer $maxchars = 4096])
  • integer $maxchars: Maximum chars per line to read

Redefined in descendants as:
  • csv_inputfile::readln() : Reads the next line of the file in the form of an array of fields as delimited by the given charater. Lines can be of a length up to the specified maximum no. of chars.

Documentation generated by phpDocumentor 1.3.0RC3