LFSStringProc Class Reference

List of all members.

Public Member Functions

 __construct ($singletonCreator=false)
singleton ()
 process ($string, $cProc=null, $cMap=null)
 processCodePages ($string, $cpFile='xhtml_table.php')
 processColours ($string, $proc=null, $map=null)
 stripCodePages ($string)
 stripColours ($string)
 setColourProcessor ($proc)
 setColourMap ($map)

Protected Member Functions

 _chunkString ($string, $pattern, $current)

Protected Attributes

 $m_sColourPattern = '/(?:\^)([0-8])/'
 $m_sColourProc = '__sProcColourCSSStyle'
 $m_aColourMap = null

Detailed Description

Provides efficient & optimized codepage and colour switch parsing.

Version:
2.0.00

Definition at line 14 of file stringproc.php.


Member Function Documentation

LFSStringProc::__construct singletonCreator = false  ) 
 

Ctor. Do not use to instantiate LFSStringProc directly. Use LFSStringProc::singleton instead.

Deprecated:
Do not use to instantiate LFSStringProc directly. Use LFSStringProc::singleton instead.
Parameters:
singletonCreator (Boolean) Set to true if you really need to use 'new' to create an instance.
Returns:
(Void)

Definition at line 42 of file stringproc.php.

References singleton().

LFSStringProc::_chunkString string,
pattern,
current
[protected]
 

This method splits a string in to chunks based on the pattern provided.

Parameters:
string (String) The string to 'chunk'.
pattern (String) The pattern to use for 'chunking'.
current (String) The default group to assign to non-assigned chunks.
Returns:
(Array) An array of chunks with their switch identifier.

Definition at line 72 of file stringproc.php.

LFSStringProc::process string,
cProc = null,
cMap = null
 

Applies both codepage and colour processing to a string using the given parameters.

Parameters:
string (String) The string to be processed.
cProc (fnCallback) The colour processor to be used.
cMap (Array) The colour map to be used.
Returns:
(Mixed) The output of the combined processors used.

Definition at line 115 of file stringproc.php.

LFSStringProc::processCodePages string,
cpFile = 'xhtml_table.php'
 

Processes codepage switches in a string. Original credit goes to Victor Van Vlaardingen because this is a derivative of his codepage_convert function.

Parameters:
string (String) The string to be processed.
cpFile (String) The codepage file to be used.
Returns:
(String) A string with codepage switches removed & entities appropriately translated.

Definition at line 129 of file stringproc.php.

LFSStringProc::processColours string,
proc = null,
map = null
 

Processes colours in the given string.

Parameters:
string (String) The string to process.
proc (fnCallback) The colour processor to use.
map (Array) The colour map to use.
Returns:
(Mixed) The output of the colour processor used.

Definition at line 166 of file stringproc.php.

LFSStringProc::setColourMap map  ) 
 

Sets the default colour map to be used if one is not given at runtime. Some processors supply their own default.

Parameters:
map (Array) The default colour map to use.
Returns:
(Void)

Definition at line 224 of file stringproc.php.

LFSStringProc::setColourProcessor proc  ) 
 

Sets the default colour processor to use if one is not given at runtume.

Parameters:
proc (fnCallback) Colour processor to use.
Returns:
(Void)

Definition at line 210 of file stringproc.php.

& LFSStringProc::singleton  ) 
 

Singleton distributor. Use this method to get an instance instead of new.

Returns:
(Object) Singleton LFSStingProc instance.

Definition at line 54 of file stringproc.php.

Referenced by __construct().

LFSStringProc::stripCodePages string  ) 
 

Strips codepage switches from a string. This should be used in preference to a blank code page because it is much faster.

Parameters:
string (String) The string to strip.
Returns:
(String) A copy of the input string with codepage switches removed.

Definition at line 185 of file stringproc.php.

LFSStringProc::stripColours string  ) 
 

Strips colour switches from a string. This should be used in preference to a 'strip' processor because it is much faster.

Parameters:
string (String) The string to strip.
Returns:
(String) A copy of the input string with colour switches removed.

Definition at line 198 of file stringproc.php.


Member Data Documentation

LFSStringProc::$m_aColourMap = null [protected]
 

(Array) This is the default colour map to use when one is not specified at runtime. If this too is not specified, the processor will use it's default.

Definition at line 32 of file stringproc.php.

LFSStringProc::$m_sColourPattern = '/(?:\^)([0-8])/' [protected]
 

(String) This is the preg_split pattern used to scan for colours.

Definition at line 20 of file stringproc.php.

LFSStringProc::$m_sColourProc = '__sProcColourCSSStyle' [protected]
 

(fnCallback) This is the current function used for processing colours after they have been scanned.

Definition at line 26 of file stringproc.php.


Generated on Wed Oct 25 03:13:33 2006 for LFSWorldParsingProviderFramework by  doxygen 1.4.6