To use BinHex for converting a Macintosh file to BinHex format, call the member functions setFileName(), setFileType(), setFileCreator(), setFlag1(), setFlag2(), setDataFork(), and setResourceFork() to set the elements to be encoded. (The library sets reasonable default values for any elements that you do not set.) Then call the encode() member function to actually perform the conversion to BinHex. Finally, call binhexChars() to get the characters of the BinHex file.
To use BinHex for converting a Macintosh file from BinHex format, call the member function setBinHexChars() to set the characters of the BinHex file to be converted. Then call decode() to actually perform the conversion. Finally, call fileName(), fileType(), fileCreator(), flag1(), flag2(), dataFork(), and resourceFork() to get the decoded elements.
Note: BinHex does not change the file name in any way. When you deal with file names, you should be aware of the fact that some filenames that are valid on a Macintosh may cause problems or unexpected results on a non-Macintosh system, and vice versa. Such problem characters include slash ('/'), colon (':'), space and possibly other characters.
Public Member Functions | |
| BinHex () | |
| Default constructor. | |
| virtual | ~BinHex () |
| Destructor. | |
| void | initialize () |
| Resets to the initial state. | |
| const char * | fileName () const |
| Gets the file name. | |
| void | setFileName (const char *name) |
| Sets the file name. | |
| void | fileType (char *buf) const |
| Gets the file type. | |
| void | setFileType (const char *type) |
| Sets the file type. | |
| void | fileCreator (char *buf) const |
| Gets the file creator. | |
| void | setFileCreator (const char *creator) |
| Sets the file creator. | |
| uint8_t | flag1 () const |
| Gets the first byte of the Macintosh Finder flags. | |
| void | setFlag1 (uint8_t flag) |
| Sets the first byte of the Macintosh Finder flags. | |
| uint8_t | flag2 () const |
| Gets the second byte of the Macintosh Finder flags. | |
| void | setFlag2 (uint8_t flag) |
| Sets the second byte of the Macintosh Finder flags. | |
| const String & | dataFork () const |
| Gets the data fork for the file. | |
| void | setDataFork (const String &bytes) |
| Sets the data fork for the file. | |
| const String & | resourceFork () const |
| Gets the resource fork for the file. | |
| void | setResourceFork (const String &bytes) |
| Sets the resource fork for the file. | |
| const String & | binhexChars () const |
| Gets the characters of the BinHex encoded file. | |
| void | setBinHexChars (const String &chars) |
| Sets the characters of the BinHex encoded file. | |
| void | encode () |
| Converts the Macintosh file information to BinHex format. | |
| int | decode () |
| Converts the Macintosh file information from BinHex format. | |
|
|
Default constructor. |
|
|
Destructor. |
|
|
Gets the characters of the BinHex encoded file.
|
|
|
Gets the data fork for the file. For files that originate on non-Macintosh systems, such as GIF or JPEG files, the file data should be set as the data fork.
|
|
|
Converts the Macintosh file information from BinHex format. Returns zero if the decode operation completes successufully; otherwise, the function returns -1.
|
|
|
Converts the Macintosh file information to BinHex format. |
|
|
Gets the file creator. Most Macintosh files have a creator, which is represented by a signature of four bytes. The creator specifies which application to launch when a file's icon is double clicked. buf should point to an array of at least four characters.
|
|
|
Gets the file name. The file name is restricted to a maximum length of 63 characters.
|
|
|
Gets the file type. All Macintosh files have a file type, which is represented by four bytes. Some examples include "TEXT" for a text file, or "APPL" for an application. buf should point to an array of at least four characters.
|
|
|
Gets the first byte of the Macintosh Finder flags. For files that originate on non-Macintosh systems, this byte should be set to zero (the default).
|
|
|
Gets the second byte of the Macintosh Finder flags. For files that originate on non-Macintosh systems, this byte should be set to zero (the default).
|
|
|
Resets the object's internal state to its initial state. You may call this member function to reuse the object for more than one encode or decode operation. |
|
|
Gets the resource fork for the file. For files that originate on non-Macintosh systems, such as GIF or JPEG files, the resource fork should normally be empty.
|
|
|
Sets the characters of the BinHex encoded file.
|
|
|
Sets the data fork for the file. For files that originate on non-Macintosh systems, such as GIF or JPEG files, the file data should be set as the data fork.
|
|
|
Sets the file creator. Most Macintosh files have a creator, which is represented by a signature of four bytes. The creator specifies which application to launch when a file's icon is double clicked. creator should point to an array of at least four characters.
|
|
|
Sets the file name. The file name is restricted to a maximum length of 63 characters.
|
|
|
Sets the file type. All Macintosh files have a file type, which is represented by four bytes. Some examples include "TEXT" for a text file, or "APPL" for an application. type should point to an array of at least four characters.
|
|
|
Sets the first byte of the Macintosh Finder flags. For files that originate on non-Macintosh systems, this byte should be set to zero (the default).
|
|
|
Sets the second byte of the Macintosh Finder flags. For files that originate on non-Macintosh systems, this byte should be set to zero (the default).
|
|
|
Sets the resource fork for the file. For files that originate on non-Macintosh systems, such as GIF or JPEG files, the resource fork should normally be empty.
|
Copyright © 2001-2007 Hunny Software, Inc. All rights reserved.