Pdf/FileParserDataSource/String.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Pdf  
Subpackage
FileParser  
Version
$Id: String.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Pdf_FileParserDataSource_String

Package: Zend\Pdf\FileParser
Concrete subclass of {@link Zend_Pdf_FileParserDataSource} that provides an interface to binary strings.

Concrete subclasses allow for parsing of in-memory, filesystem, and other sources through a common API. These subclasses also take care of error handling and other mundane tasks.

Subclasses must implement at minimum __construct(), __destruct(), readBytes(), and readAllBytes(). Subclasses should also override moveToOffset() and __toString() as appropriate.

Parent(s)
\Zend_Pdf_FileParserDataSource
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedinteger $_offset = 0
inherited
Byte offset of the current read position within the data source.
Inherited from: \Zend_Pdf_FileParserDataSource::$$_offset
Default value0Details
Type
integer
Inherited_from
\Zend_Pdf_FileParserDataSource::$$_offset  
>VPropertyprotectedinteger $_size = 0
inherited
Total size in bytes of the data source.
Inherited from: \Zend_Pdf_FileParserDataSource::$$_size
Default value0Details
Type
integer
Inherited_from
\Zend_Pdf_FileParserDataSource::$$_size  
>VPropertyprotectedstring $_string = ''
The string to parse.
Default value''Details
Type
string

Methods

methodpublic__construct(string $string) : void

Object constructor.

Verifies that the string is not empty.

Parameters
NameTypeDescription
$stringstring

String to parse.

methodpublic__destruct() : void

Object destructor.

Closes the data source.

May also perform cleanup tasks such as deleting temporary files.

methodpublic__toString() : string

Returns a string containing the parsed string's length.

Subclasses should override this method to provide a more specific description of the actual object being represented.

Returns
TypeDescription
string
methodpublicgetOffset() : integer
inherited

Returns the byte offset of the current read position within the data source.

Inherited from: \Zend_Pdf_FileParserDataSource::getOffset()
Returns
TypeDescription
integer
methodpublicgetSize() : integer
inherited

Returns the total size in bytes of the data source.

Inherited from: \Zend_Pdf_FileParserDataSource::getSize()
Returns
TypeDescription
integer
methodpublicmoveToOffset(integer $offset) : void
inherited

Moves the current read position to the specified byte offset.

Inherited from: \Zend_Pdf_FileParserDataSource::moveToOffset()

Throws an exception you attempt to move before the beginning or beyond the end of the data source.

If a subclass needs to perform additional tasks (such as performing a fseek() on a filesystem source), it should do so after calling this parent method.

Parameters
NameTypeDescription
$offsetinteger

Destination byte offset.

Throws
ExceptionDescription
\Zend_Pdf_Exception
methodpublicreadAllBytes() : string

Returns the entire string.

Preserves the current read position.

Returns
TypeDescription
string
methodpublicreadBytes(integer $byteCount) : string

Returns the specified number of raw bytes from the string at the byte offset of the current read position.

Advances the read position by the number of bytes read.

Throws an exception if there is insufficient data to completely fulfill the request.

Parameters
NameTypeDescription
$byteCountinteger

Number of bytes to read.

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Pdf_Exception
methodpublicskipBytes(integer $byteCount) : void
inherited

Shifts the current read position within the data source by the specified number of bytes.

Inherited from: \Zend_Pdf_FileParserDataSource::skipBytes()

You may move forward (positive numbers) or backward (negative numbers). Throws an exception you attempt to move before the beginning or beyond the end of the data source.

Parameters
NameTypeDescription
$byteCountinteger

Number of bytes to skip.

Throws
ExceptionDescription
\Zend_Pdf_Exception
Documentation was generated by phpDocumentor 2.0.0a12.