Strings
[ class tree: Strings ] [ index: Strings ] [ all elements ]

Class: STRlines

Source Location: /STRlines.php

Class Overview

Strings
   |
   --STRlines

This class manages lines (strings) objects.


Author(s):

Version:

  • 2.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: Strings

Strings::__construct()
Construction function
Strings::console()
Console function
Strings::IsUTF8()
UTF8 detection function
Strings::QuoteStrip()
Quotes stripping function
Strings::RemoveAccent()
Accents removal function
Strings::RemoveSpaces()
Spaces removal function
Strings::stringHasNumbers()
Numbers detection function
Strings::ToUTF8()
UTF8 conversion function
Strings::ucwordsw()
Special uppercase function

Class Details

[line 31]
This class manages lines (strings) objects.

Created on 15 apr 09

Changes: 1.0 -> 2.0: 28 jul 09 updated: file is PEAR compatible renamed Lines class to STRlines




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  2.0
license:  GNU Public License


[ Top ]


Class Variables

$aWords = array()

[line 47]

Variable that contains array containings words (Strings objects)



Tags:

access:  public

Type:   array


[ Top ]



Class Methods


method cleanLine [line 128]

object this cleanLine( array $aDelchars, [array $aRepeatchars = null])

Line cleaner function

This function is used to clean a line. Result is stored in $this->value and object is returned

  1.  <?php
  2.  $oLines            new STRlines();
  3.  $oLines->value    "THIS IS
  4.  THE    STORY OF
  5.  A DOG";
  6.  $oLines->readLine(1);
  7.  $oLines->cleanLine(array("O"),array(" ");
  8.  // THE STRY F
  9.  ?>




Tags:

return:  line (object)
since:  version 1.0
uses:  STRregexs::ProtectRegex()


Parameters:

array   $aDelchars   characters to be deleted
array   $aRepeatchars   repeated characters to be deleted

[ Top ]

method formatLine [line 321]

object this formatLine( $aFormats, int $pointer, string $word_exploder)

Line formater function

This function is used to format line words using identifier like "TEXT", "DATE", "TIME", "TRASH". Result is stored in $this->word_exploder and object is returned

  1.  <?php
  2.  $value="this is a
  3.  test for
  4.     foo bar      is a test   ";
  5.  $oLine        new STRlines();
  6.  $oLine->value $value;
  7.  $oLine->readLine(2);
  8.  $oLine->cleanLine(null," ");
  9.  $oLine->splitLine(5);
  10.  $oLine->formatLine(array("TEXT","TEXT","TEXT"));
  11.  echo $oLine->value;
  12.  // Array ( [0] => foo bar [1] => is [2] => a test )
  13.  ?>




Tags:

return:  line (object)
since:  version 1.0
uses:  STRtimes::formatTime()
uses:  STRdates::convertDMY2YMD()


Parameters:

int   $pointer   character position from which the words will be splitted
string   $word_exploder   word exploder string
   $aFormats  

[ Top ]

method readLine [line 76]

object this readLine( [int $lineNumber = 0])

Line reader function

This function is used to read a specific line. Result is stored in $this->value and object is returned

  1.  <?php
  2.  $oLines        new STRlines();
  3.  $oLines->value "THIS IS
  4.  THE STORY OF
  5.  A DOG";
  6.  echo $oLines->readLine(1);
  7.  // THE STORY OF
  8.  ?>




Tags:

return:  line (object)
since:  version 1.0


Parameters:

int   $lineNumber   number of the line

[ Top ]

method setWordExploder [line 197]

object this setWordExploder( [string $word_exploder = null])

Item exploder setter function

This function is used to set $this->word_exploder Result is stored in $this->word_exploder and object is returned

  1.  <?php
  2.  $oLines            new STRlines();
  3.  $oLines->setWordExploder("/");
  4.  ?>




Tags:

return:  line (object)
since:  version 1.0


Parameters:

string   $word_exploder   word exploder string

[ Top ]

method splitLine [line 243]

object this splitLine( [int $pointer = 0], [string $word_exploder = null])

Line splitter function

This function is used to split line into words objects Result is stored in $this->aWords and object is returned

  1.  <?php
  2.  $value="this is a
  3.  test for
  4.     foo bar      is a test   ";
  5.  $oLine            new STRlines();
  6.  $oLine->value    $value;
  7.  $oLine->readLine(2);
  8.  $oLine->cleanLine(null," ");
  9.  $oLine->splitLine(5);
  10.  print_r($oLine->aWords);
  11.  // Array ( [0] => foo bar [1] => is [2] => a [3] => test )
  12.  ?>




Tags:

return:  line (object)
since:  version 1.0


Parameters:

int   $pointer   character position from which the words will be splitted
string   $word_exploder   word exploder string

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:47 +0200 by phpDocumentor 1.4.1