Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
screen () | |
parse () | |
__construct (Zend_Pdf_FileParserDataSource $dataSource) | |
__destruct () | |
isScreened () | |
isParsed () | |
getDataSource () | |
moveToOffset ($offset) | |
getOffset () | |
getSize () | |
readBytes ($byteCount) | |
skipBytes ($byteCount) | |
readInt ($size, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN) | |
readUInt ($size, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN) | |
isBitSet ($bit, $bitField) | |
readFixed ($mantissaBits, $fractionBits, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN) | |
readStringUTF16 ($byteCount, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN, $characterSet='') | |
readStringMacRoman ($byteCount, $characterSet='') | |
readStringPascal ($characterSet='', $lengthBytes=1) | |
Data Fields | |
const | BYTE_ORDER_LITTLE_ENDIAN = 0 |
const | BYTE_ORDER_BIG_ENDIAN = 1 |
Protected Attributes | |
$_isScreened = false | |
$_isParsed = false | |
$_dataSource = null | |
Definition at line 39 of file FileParser.php.
__construct | ( | Zend_Pdf_FileParserDataSource | $dataSource | ) |
Object constructor.
Verifies that the data source has been properly initialized.
Zend_Pdf_FileParserDataSource | $dataSource |
Zend_Pdf_Exception |
Definition at line 113 of file FileParser.php.
__destruct | ( | ) |
getDataSource | ( | ) |
Returns the data source object representing the file being parsed.
Definition at line 161 of file FileParser.php.
getOffset | ( | ) |
Definition at line 180 of file FileParser.php.
getSize | ( | ) |
Definition at line 184 of file FileParser.php.
isBitSet | ( | $bit, | |
$bitField | |||
) |
Returns true if the specified bit is set in the integer bitfield.
integer | $bit | Bit number to test (i.e. - 0-31) |
integer | $bitField |
Definition at line 339 of file FileParser.php.
isParsed | ( | ) |
Returns true if the file has been successfully parsed.
Definition at line 151 of file FileParser.php.
isScreened | ( | ) |
Returns true if the file has passed a cursory validation check.
Definition at line 141 of file FileParser.php.
moveToOffset | ( | $offset | ) |
Convenience wrapper for the data source object's moveToOffset() method.
integer | $offset | Destination byte offset. |
Zend_Pdf_Exception |
Definition at line 175 of file FileParser.php.
|
abstract |
Reads and parses the complete binary file.
Must set $this->_isParsed to true if successful.
Zend_Pdf_Exception |
readBytes | ( | $byteCount | ) |
Convenience wrapper for the data source object's readBytes() method.
integer | $byteCount | Number of bytes to read. |
Zend_Pdf_Exception |
Definition at line 195 of file FileParser.php.
readFixed | ( | $mantissaBits, | |
$fractionBits, | |||
$byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN |
|||
) |
Reads the signed fixed-point number from the binary file at the current byte offset.
Common fixed-point sizes are 2.14 and 16.16.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
integer | $mantissaBits | Number of bits in the mantissa |
integer | $fractionBits | Number of bits in the fraction |
integer | $byteOrder | (optional) Big- or little-endian byte order. Use the BYTE_ORDER_ constants defined in Zend_Pdf_FileParser. If omitted, uses big-endian. |
Zend_Pdf_Exception |
Definition at line 363 of file FileParser.php.
readInt | ( | $size, | |
$byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN |
|||
) |
Reads the signed integer value from the binary file at the current byte offset.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
integer | $size | Size of integer in bytes: 1-4 |
integer | $byteOrder | (optional) Big- or little-endian byte order. Use the BYTE_ORDER_ constants defined in Zend_Pdf_FileParser. If omitted, uses big-endian. |
Zend_Pdf_Exception |
Definition at line 228 of file FileParser.php.
readStringMacRoman | ( | $byteCount, | |
$characterSet = '' |
|||
) |
Reads the Mac Roman-encoded string from the binary file at the current byte offset.
You must supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
integer | $byteCount | Number of bytes (characters) to return. |
string | $characterSet | (optional) Desired resulting character set. You may use any character set supported by iconv(). If omitted, uses 'current locale'. |
Zend_Pdf_Exception |
Definition at line 442 of file FileParser.php.
readStringPascal | ( | $characterSet = '' , |
|
$lengthBytes = 1 |
|||
) |
Reads the Pascal string from the binary file at the current byte offset.
The length of the Pascal string is determined by reading the length bytes which preceed the character data. You must supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
string | $characterSet | (optional) Desired resulting character set. You may use any character set supported by iconv(). If omitted, uses 'current locale'. |
integer | $lengthBytes | (optional) Number of bytes that make up the length. Default is 1. |
Zend_Pdf_Exception |
Definition at line 472 of file FileParser.php.
readStringUTF16 | ( | $byteCount, | |
$byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN , |
|||
$characterSet = '' |
|||
) |
Reads the Unicode UTF-16-encoded string from the binary file at the current byte offset.
The byte order of the UTF-16 string must be specified. You must also supply the desired resulting character set.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
Consider changing $byteCount to a character count. They are not always equivalent (in the case of surrogates).
Make $byteOrder optional if there is a byte-order mark (BOM) in the string being extracted.
integer | $byteCount | Number of bytes (characters * 2) to return. |
integer | $byteOrder | (optional) Big- or little-endian byte order. Use the BYTE_ORDER_ constants defined in Zend_Pdf_FileParser. If omitted, uses big-endian. |
string | $characterSet | (optional) Desired resulting character set. You may use any character set supported by iconv(). If omitted, uses 'current locale'. |
Zend_Pdf_Exception |
Definition at line 401 of file FileParser.php.
readUInt | ( | $size, | |
$byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN |
|||
) |
Reads the unsigned integer value from the binary file at the current byte offset.
Advances the offset by the number of bytes read. Throws an exception if an error occurs.
NOTE: If you ask for a 4-byte unsigned integer on a 32-bit machine, the resulting value WILL BE SIGNED because PHP uses signed integers internally for everything. To guarantee portability, be sure to use bitwise operators operators on large unsigned integers!
integer | $size | Size of integer in bytes: 1-4 |
integer | $byteOrder | (optional) Big- or little-endian byte order. Use the BYTE_ORDER_ constants defined in Zend_Pdf_FileParser. If omitted, uses big-endian. |
Zend_Pdf_Exception |
Definition at line 303 of file FileParser.php.
|
abstract |
Performs a cursory check to verify that the binary file is in the expected format. Intended to quickly weed out obviously bogus files.
Must set $this->_isScreened to true if successful.
Zend_Pdf_Exception |
skipBytes | ( | $byteCount | ) |
Convenience wrapper for the data source object's skipBytes() method.
integer | $byteCount | Number of bytes to skip. |
Zend_Pdf_Exception |
Definition at line 206 of file FileParser.php.
|
protected |
Definition at line 74 of file FileParser.php.
|
protected |
Definition at line 68 of file FileParser.php.
|
protected |
Definition at line 62 of file FileParser.php.
const BYTE_ORDER_BIG_ENDIAN = 1 |
Big-endian byte order (0x01 0x02 0x03 0x04).
Definition at line 51 of file FileParser.php.
const BYTE_ORDER_LITTLE_ENDIAN = 0 |
Little-endian byte order (0x04 0x03 0x02 0x01).
Definition at line 46 of file FileParser.php.