FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ReadInputFile Class Reference
Collaboration diagram for ReadInputFile:
Collaboration graph

Public Member Functions

 __construct ($file)
 
 getError ()
 
 getFileResource ()
 
 getLine ($FD)
 

Public Attributes

 $inputFile
 

Protected Attributes

 $error
 
 $fileResource
 

Detailed Description

class to read simple input file. Takes care of # comment lines and blank lines.

Version
"$Id: ReadInputFile.php 2187 2009-05-29 04:59:35Z rrando $"

Created on Jun 6, 2008

Definition at line 17 of file ReadInputFile.php.

Constructor & Destructor Documentation

◆ __construct()

ReadInputFile::__construct (   $file)

function __construct Constructor for ReadInputFile

Parameters
string$file,thepath to the input file to read The file should exist and be readable.
Returns
the opened file resource or NULL on failure

Definition at line 32 of file ReadInputFile.php.

Member Function Documentation

◆ getLine()

ReadInputFile::getLine (   $FD)

function getLine

Get a line of data from the open file resource. Will skip any comment lines or blank lines. A comment line is a line starting with #

getline always reads 1024 bytes of data from the file. It expects each line to have a new-line which will terminate the read. If the file is not formatted this way, it will just return 1k of data per read.

Parameters
$FDopened file resource e.g. $f = new ReadInputFile('foo'); $FD = f->getFileResource(); $f->getLine(FD);
Returns
the data line or NULL on EOF/Failure

Definition at line 78 of file ReadInputFile.php.


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