Pdf/FileParserDataSource/File.php

Show: inherited
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 [email protected] 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: File.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Pdf_FileParserDataSource_File

Package: Zend\Pdf\FileParser

Concrete subclass of {@link Zend_Pdf_FileParserDataSource} that provides an interface to filesystem objects.

Note that this class cannot be used for other sources that may be supported by fopen() (through URL wrappers). It may be used for local filesystem objects only.

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

Properties

Propertyprotectedstring $_filePath = ''

Fully-qualified path to the file.

Default value''Details
Type
string
Propertyprotectedresource $_fileResource = null

File resource handle .

Default valuenullDetails
Type
resource
Propertyprotectedinteger $_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  
Propertyprotectedinteger $_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  

Methods

methodpublic__construct(string $filePath) : void

Object constructor.

Validates the path to the file, ensures that it is readable, then opens it for reading.

Throws an exception if the file is missing or cannot be opened.

Parameters
Name Type Description
$filePath string

Fully-qualified path to the file.

Throws
Exception Description
\Zend_Pdf_Exception
methodpublic__destruct() : void

Object destructor.

Closes the file if it had been successfully opened.

methodpublic__toString() : string

Returns the full filesystem path of the file.

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

Returns
Type Description
string
methodpublicgetOffset() : integer
inherited

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

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

Returns the total size in bytes of the data source.

Inherited from: \Zend_Pdf_FileParserDataSource::getSize()
Returns
Type Description
integer
methodpublicmoveToOffset(integer $offset) : void

Seeks the file read position to the specified byte offset.

Throws an exception if the file pointer cannot be moved or if it is moved beyond EOF (end of file).

Parameters
Name Type Description
$offset integer

Destination byte offset.

Throws
Exception Description
\Zend_Pdf_Exception
methodpublicreadAllBytes() : string

Returns the entire contents of the file as a string.

Preserves the current file seek position.

Returns
Type Description
string
methodpublicreadBytes(integer $byteCount) : string

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

Advances the read position by the number of bytes read.

Throws an exception if an error was encountered while reading the file or if there is insufficient data to completely fulfill the request.

Parameters
Name Type Description
$byteCount integer

Number of bytes to read.

Returns
Type Description
string
Throws
Exception Description
\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
Name Type Description
$byteCount integer

Number of bytes to skip.

Throws
Exception Description
\Zend_Pdf_Exception
Documentation was generated by phpDocumentor 2.0.0a8.