~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to mimelib/doc/binhex.html

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<HTML>
2
 
<HEAD>
3
 
  <TITLE> DwBinhex Man Page </TITLE>
4
 
</HEAD>
5
 
<BODY BGCOLOR="#FFFFFF">
6
 
<H2>
7
 
  <FONT COLOR="navy"> NAME </FONT>
8
 
</H2>
9
 
<P>
10
 
DwBinhex -- Class for converting files to or from Binhex 4.0 format
11
 
<H2>
12
 
  <FONT COLOR="navy"> SYNOPSIS </FONT>
13
 
</H2>
14
 
<PRE>
15
 
class DW_EXPORT DwBinhex {
16
 
 
17
 
public:
18
 
 
19
 
    <A HREF="binhex.html#DwBinhex">DwBinhex</A>();
20
 
    virtual ~DwBinhex();
21
 
    void <A HREF="binhex.html#Initialize">Initialize</A>();
22
 
    const char* <A HREF="binhex.html#FileName">FileName</A>() const;
23
 
    void <A HREF="binhex.html#SetFileName">SetFileName</A>(const char* aName);
24
 
    void <A HREF="binhex.html#FileType">FileType</A>(char* aBuf) const;
25
 
    void <A HREF="binhex.html#SetFileType">SetFileType</A>(const char* aType);
26
 
    void <A HREF="binhex.html#FileCreator">FileCreator</A>(char* aBuf) const;
27
 
    void <A HREF="binhex.html#SetFileCreator">SetFileCreator</A>(const char* aType);
28
 
    DwUint8 <A HREF="binhex.html#Flag1">Flag1</A>() const;
29
 
    void <A HREF="binhex.html#SetFlag1">SetFlag1</A>(DwUint8 aFlag);
30
 
    DwUint8 <A HREF="binhex.html#Flag2">Flag2</A>() const;
31
 
    void <A HREF="binhex.html#SetFlag2">SetFlag2</A>(DwUint8 aFlag);
32
 
    const DwString&amp; <A HREF="binhex.html#DataFork">DataFork</A>() const;
33
 
    void <A HREF="binhex.html#SetDataFork">SetDataFork</A>(const DwString&amp; aStr);
34
 
    const DwString&amp; <A HREF="binhex.html#ResourceFork">ResourceFork</A>() const;
35
 
    void <A HREF="binhex.html#SetResourceFork">SetResourceFork</A>(const DwString&amp; aStr);
36
 
    const DwString&amp; <A HREF="binhex.html#BinhexChars">BinhexChars</A>() const;
37
 
    void <A HREF="binhex.html#SetBinhexChars">SetBinhexChars</A>(const DwString&amp; aStr);
38
 
    void <A HREF="binhex.html#Encode">Encode</A>();
39
 
    int <A HREF="binhex.html#Decode">Decode</A>();
40
 
};
41
 
</PRE>
42
 
<H2>
43
 
  <FONT COLOR="navy"> DESCRIPTION </FONT>
44
 
</H2>
45
 
<P>
46
 
<B><TT>DwBinhex</TT></B> converts data to or from Binhex 4.0 format. Binhex
47
 
is a format used almost exclusively on Macintosh computers for encoding files
48
 
into text characters for transmission through the mail transport system or
49
 
for archiving on non-Macintosh systems. The format includes the file name,
50
 
file type, file creator, Macintosh Finder flags, data fork, resource fork,
51
 
and checksums. In MIME, the use of Binhex is deprecated; applesingle and
52
 
appledouble are the preferred format for encoding Macintosh files. The Binhex
53
 
4.0 format is described in RFC-1741. Binhex is a widely used, <I>de facto</I>
54
 
standard, but it is not an official Internet standard.
55
 
<P>
56
 
To use <B><TT>DwBinhex</TT></B> for converting a Macintosh file to Binex
57
 
format, call the member functions <B><TT>SetFileName()</TT></B>,
58
 
<B><TT>SetFileType()</TT></B>, <B><TT>SetFileCreator()</TT></B>,
59
 
<B><TT>SetFlag1()</TT></B>, <B><TT>SetFlag2()</TT></B>,
60
 
<B><TT>SetDataFork()</TT></B>, and <B><TT>SetResourceFork()</TT></B> to set
61
 
the elements to be encoded. Any elements that are not set by calling one
62
 
of the member functions are assigned reasonable defaults. Then call the
63
 
<B><TT>Encode()</TT></B> member function to actually perform the conversion
64
 
to Binhex. Finally, call <B><TT>BinhexChars()</TT></B> to retrieve the Binhex
65
 
characters.
66
 
<P>
67
 
To use <B><TT>DwBinhex</TT></B> for converting a Macintosh file from Binhex
68
 
format, call the member function <B><TT>SetBinhexChars()</TT></B> to assign
69
 
the Binhex characters to be converted. Then call <B><TT>Decode()</TT></B>
70
 
to actually perform the conversion. Finally, call
71
 
<B><TT>FileName()</TT></B>, <B><TT>FileType()</TT></B>,
72
 
<B><TT>FileCreator()</TT></B>, <B><TT>Flag1()</TT></B>,
73
 
<B><TT>Flag2()</TT></B>, <B><TT>DataFork()</TT></B>, and
74
 
<B><TT>ResourceFork()</TT></B> to extract the decoded elements.
75
 
<P>
76
 
Note: <B><TT>DwBinhex</TT></B> does not change the file name in any way.
77
 
When you you are dealing with file names, you should be aware of the fact
78
 
that some filenames that are valid on a Macintosh may cause problems or
79
 
unexpected results on a non-Macintosh system, and vice versa. Such problem
80
 
characters include slash ('/'), colon (':'), space and possibly other characters.
81
 
<H2>
82
 
  <FONT COLOR="navy"> Public Member Functions </FONT>
83
 
</H2>
84
 
<P>
85
 
<FONT COLOR="teal"><B> <A NAME="DwBinhex">DwBinhex</A>() </B></FONT>
86
 
<P>
87
 
This is the default constructor.
88
 
<P>
89
 
<FONT COLOR="teal"><B> void <A NAME="Initialize">Initialize</A>() </B></FONT>
90
 
<P>
91
 
Resets the object's internal state to its initial state. Call this member
92
 
function to reuse the object for more than one encode or decode operation.
93
 
<P>
94
 
<FONT COLOR="teal"><B> const char* <A NAME="FileName">FileName</A>()
95
 
const<BR>
96
 
void <A NAME="SetFileName">SetFileName</A>(const char* aName) </B></FONT>
97
 
<P>
98
 
Gets or sets the file name. The file name is restricted to a maximum length
99
 
of 63 characters.
100
 
<P>
101
 
<FONT COLOR="teal"><B> void <A NAME="FileType">FileType</A>(char* aBuf)
102
 
const<BR>
103
 
void <A NAME="SetFileType">SetFileType</A>(const char* aType) </B></FONT>
104
 
<P>
105
 
Gets or sets the file type. All Macintosh files have a file type, which is
106
 
represented by four bytes. Some examples include "TEXT" for a text file,
107
 
or "APPL" for an application. <B><TT>aBuf</TT></B> should point to an array
108
 
of at least four characters.
109
 
<P>
110
 
<FONT COLOR="teal"><B> void <A NAME="FileCreator">FileCreator</A>(char* aBuf)
111
 
const <BR>
112
 
void <A NAME="SetFileCreator">SetFileCreator</A>(const char* aType)
113
 
</B></FONT>
114
 
<P>
115
 
Gets or sets the file creator. Most Macintosh files have a creator, which
116
 
is represented by a signature of four bytes. The creator specifies which
117
 
application to launch when a file's icon is double clicked.
118
 
<B><TT>aBuf</TT></B> should point to an array of at least four characters.
119
 
<P>
120
 
<FONT COLOR="teal"><B> DwUint8 <A NAME="Flag1">Flag1</A>() const <BR>
121
 
void <A NAME="SetFlag1">SetFlag1</A>(DwUint8 aFlag) </B></FONT>
122
 
<P>
123
 
Gets or sets the first byte of the Macintosh Finder flags. For files that
124
 
originate on non-Macintosh systems, this byte should be set to zero (the
125
 
default).
126
 
<P>
127
 
<FONT COLOR="teal"><B> DwUint8 <A NAME="Flag2">Flag2</A>() const <BR>
128
 
void <A NAME="SetFlag2">SetFlag2</A>(DwUint8 aFlag) </B></FONT>
129
 
<P>
130
 
Gets or sets the second byte of the Macintosh Finder flags. For files that
131
 
originate on non-Macintosh systems, this byte should be set to zero (the
132
 
default).
133
 
<P>
134
 
<FONT COLOR="teal"><B> const DwString&amp; <A NAME="DataFork">DataFork</A>()
135
 
const <BR>
136
 
void <A NAME="SetDataFork">SetDataFork</A>(const DwString&amp; aStr)
137
 
</B></FONT>
138
 
<P>
139
 
Gets or sets the data fork for the file. For files that originate on
140
 
non-Macintosh systems, such as a GIF or JPEG file, the file data should be
141
 
set as the data fork.
142
 
<P>
143
 
<FONT COLOR="teal"><B> const DwString&amp;
144
 
<A NAME="ResourceFork">ResourceFork</A>() const<BR>
145
 
void <A NAME="SetResourceFork">SetResourceFork</A>(const DwString&amp; aStr)
146
 
</B></FONT>
147
 
<P>
148
 
Gets or sets the resource fork for the file. For files that originate on
149
 
non-Macintosh systems, such as a GIF or JPEG file, the resource should be
150
 
normally be empty.
151
 
<P>
152
 
<FONT COLOR="teal"><B> const DwString&amp;
153
 
<A NAME="BinhexChars">BinhexChars</A>() const<BR>
154
 
void <A NAME="SetBinhexChars">SetBinhexChars</A>(const DwString&amp; aStr)
155
 
</B></FONT>
156
 
<P>
157
 
Gets or sets the characters of the Binhex encoded file.
158
 
<P>
159
 
<FONT COLOR="teal"><B> void <A NAME="Encode">Encode</A>() </B></FONT>
160
 
<P>
161
 
Converts the Macintosh file information to Binhex format.
162
 
<P>
163
 
<FONT COLOR="teal"><B> int <A NAME="Decode">Decode</A>() </B></FONT>
164
 
<P>
165
 
Converts the Macintosh file information from Binhex format. Returns zero
166
 
if the decode operation completes successufully; otherwise, the function
167
 
returns -1.
168
 
<P>
169
 
</BODY></HTML>