Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Zend_Pdf_StringParser Class Reference

Public Member Functions

 cleanUp ()
 Clean up resources.
 
 skipWhiteSpace ($skipComment=true)
 Skip white space.
 
 skipComment ()
 Skip comment.
 
 readComment ()
 Read comment line.
 
 readLexeme ()
 Returns next lexeme from a pdf stream.
 
 readElement ($nextLexeme=null)
 Read elemental object from a PDF stream.
 
 getObject ($offset, Zend_Pdf_Element_Reference_Context $context)
 Read inderect object from a PDF stream.
 
 getLength ()
 Get length of source string.
 
 getString ()
 Get source string.
 
 setContext (Zend_Pdf_Element_Reference_Context $context)
 Set current context.
 
 __construct ($source, Zend_Pdf_ElementFactory_Interface $factory)
 Object constructor.
 

Static Public Member Functions

static isWhiteSpace ($chCode)
 Character with code $chCode is white space.
 
static isDelimiter ($chCode)
 Character with code $chCode is a delimiter character.
 
static parseIntFromStream ($stream, $offset, $size)
 Parse integer value from a binary stream.
 

Public Attributes

 $data = ''
 
 $offset = 0
 

Constructor & Destructor Documentation

__construct (   $source,
Zend_Pdf_ElementFactory_Interface  $factory 
)

Object constructor.

Note: PHP duplicates string, which is sent by value, only of it's updated. Thus we don't need to care about overhead

Parameters
string$pdfString
Zend_Pdf_ElementFactory_Interface$factory

Member Function Documentation

cleanUp ( )

Clean up resources.

Clear current state to remove cyclic object references

getLength ( )

Get length of source string.

Returns
integer
getObject (   $offset,
Zend_Pdf_Element_Reference_Context  $context 
)

Read inderect object from a PDF stream.

Parameters
integer$offset
Zend_Pdf_Element_Reference_Context$context
Returns
Zend_Pdf_Element_Object

Object is not generated by factory (thus it's not marked as modified object). But factory is assigned to the obect.

It's a stream object

References are automatically dereferenced at this moment.

'stream' keyword must be followed by either cr-lf sequence or lf character only. This restriction gives the possibility to recognize all cases exactly

getString ( )

Get source string.

Returns
string
static isDelimiter (   $chCode)
static

Character with code $chCode is a delimiter character.

Parameters
integer$chCode
Returns
boolean
static isWhiteSpace (   $chCode)
static

Character with code $chCode is white space.

Parameters
integer$chCode
Returns
boolean
static parseIntFromStream (   $stream,
  $offset,
  $size 
)
static

Parse integer value from a binary stream.

Parameters
string$stream
integer$offset
integer$size
Returns
integer
readComment ( )

Read comment line.

Returns
string

Check if it's a comment line

readElement (   $nextLexeme = null)

Read elemental object from a PDF stream.

Returns
Zend_Pdf_Element
Exceptions
Zend_Pdf_Exception

Note: readElement() method is a public method and could be invoked from other classes. If readElement() is used not by Zend_Pdf_StringParser::getObject() method, then we should not care about _elements member management.

readLexeme ( )

Returns next lexeme from a pdf stream.

Returns
string
setContext ( Zend_Pdf_Element_Reference_Context  $context)

Set current context.

Parameters
Zend_Pdf_Element_Reference_Context$context
skipComment ( )

Skip comment.

skipWhiteSpace (   $skipComment = true)

Skip white space.

Parameters
boolean$skipComment

Original (non-optimized) implementation.

Member Data Documentation

$data = ''
$offset = 0