IniGroups Class Reference
[Example classes]

Class to iterate all groups within an ini file. More...

Inheritance diagram for IniGroups:

Inheritance graph
{KeyFilter\n|- $regex\l|+ __construct()\l+ accept()\l+ getRegex()\l# __clone()\l}
[legend]
Collaboration diagram for IniGroups:

Collaboration graph
{KeyFilter\n|- $regex\l|+ __construct()\l+ accept()\l+ getRegex()\l# __clone()\l}
[legend]
List of all members.

Public Member Functions

 __construct ($file)
 accept ()
 current ()
 getRegex ()
 key ()

Protected Member Functions

 __clone ()

Detailed Description

Class to iterate all groups within an ini file.

Author:
Marcus Boerger
Version:
1.1
Using this class you can iterator over all groups of a ini file.

This class uses a 'is-a' relation to KeyFilter in contrast to a 'has-a' relation. Doing so both current() and key() methods must be overwritten. If it would use a 'has-a' relation there would be much more to type... but for puritists that would allow correctness in so far as then no key() would be needed.

Definition at line 28 of file inigroups.inc.


Constructor & Destructor Documentation

IniGroups::__construct ( file  ) 

Construct an ini file group iterator from a filename.

Parameters:
file Ini file to open.

Definition at line 35 of file inigroups.inc.

00035                                 {
00036         parent::__construct(new DbaReader($file, 'inifile'), '^\[.*\]$');
00037     }


Member Function Documentation

KeyFilter::__clone (  )  [protected, inherited]

hidden __clone

Definition at line 58 of file keyfilter.inc.

00059     {
00060         // disallow clone 
00061     }

KeyFilter::accept (  )  [inherited]

Returns:
whether the current key mathes the regular expression

Definition at line 43 of file keyfilter.inc.

00044     {
00045         return ereg($this->regex, $this->getInnerIterator()->key());
00046     }

IniGroups::current (  ) 

Returns:
The current group.

Definition at line 42 of file inigroups.inc.

00042                        {
00043         return substr(parent::key(),1,-1);
00044     }

KeyFilter::getRegex (  )  [inherited]

Returns:
regular expression used as filter

Definition at line 50 of file keyfilter.inc.

00051     {
00052         return $this->regex;
00053     }

IniGroups::key (  ) 

Returns:
The current group.

Definition at line 49 of file inigroups.inc.

00049                    {
00050         return substr(parent::key(),1,-1);
00051     }


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 01:05:54 2007 for SPL-StandardPHPLibrary by  doxygen 1.5.2