Public Member Functions | |
__construct ($filename) | |
open ($filename) | |
The file must be seekable, such as local filesystem. | |
isValid () | |
Does this appear to be a valid MacBinary archive? | |
dataForkLength () | |
Get length of data fork. | |
extractData ($destination) | |
Copy the data fork to an external file or resource. | |
close () | |
loadHeader () | |
Check if the given file appears to be MacBinary-encoded, as Internet Explorer on Mac OS may provide for unknown types. | |
calcCRC ($data, $seed=0) | |
Calculate a 16-bit CRC value as for MacBinary headers. | |
copyBytesTo ($destination, $bytesToCopy) | |
hexdump ($data) | |
Hex dump of the header for debugging. |
Copyright (C) 2005 Brion Vibber <brion@pobox.com> Portions based on Convert::BinHex by Eryq et al http://www.mediawiki.org/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
Definition at line 28 of file MacBinary.php.
MacBinary::__construct | ( | $ | filename | ) |
MacBinary::calcCRC | ( | $ | data, | |
$ | seed = 0 | |||
) |
Calculate a 16-bit CRC value as for MacBinary headers.
Adapted from perl5 Convert::BinHex by Eryq, based on the mcvert utility (Doug Moore, April '87), with magic array thingy by Jim Van Verth. http://search.cpan.org/~eryq/Convert-BinHex-1.119/lib/Convert/BinHex.pm
string | $data | |
int | $seed |
Definition at line 181 of file MacBinary.php.
References $i.
Referenced by loadHeader().
MacBinary::close | ( | ) |
Definition at line 83 of file MacBinary.php.
MacBinary::copyBytesTo | ( | $ | destination, | |
$ | bytesToCopy | |||
) |
resource | $destination | |
int | $bytesToCopy |
Definition at line 234 of file MacBinary.php.
Referenced by extractData().
MacBinary::dataForkLength | ( | ) |
MacBinary::extractData | ( | $ | destination | ) |
Copy the data fork to an external file or resource.
resource | $destination |
Definition at line 70 of file MacBinary.php.
References copyBytesTo(), and isValid().
MacBinary::hexdump | ( | $ | data | ) |
Hex dump of the header for debugging.
Definition at line 247 of file MacBinary.php.
References $i, $wgDebugLogFile, and wfDebug().
MacBinary::isValid | ( | ) |
Does this appear to be a valid MacBinary archive?
Definition at line 53 of file MacBinary.php.
Referenced by extractData().
MacBinary::loadHeader | ( | ) |
Check if the given file appears to be MacBinary-encoded, as Internet Explorer on Mac OS may provide for unknown types.
http://www.lazerware.com/formats/macbinary/macbinary_iii.html If ok, load header data.
Definition at line 98 of file MacBinary.php.
References $fname, calcCRC(), and wfDebug().
Referenced by __construct().
MacBinary::open | ( | $ | filename | ) |
The file must be seekable, such as local filesystem.
Remote URLs probably won't work.
string | $filename |
Definition at line 40 of file MacBinary.php.
References $filename.
Referenced by __construct().