|
a/src/bincimapmime/mime-printbody.cc |
|
b/src/bincimapmime/mime-printbody.cc |
|
... |
|
... |
21 |
* You should have received a copy of the GNU General Public License
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
23 |
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
|
24 |
* --------------------------------------------------------------------
|
24 |
* --------------------------------------------------------------------
|
25 |
*/
|
25 |
*/
|
26 |
#ifdef HAVE_CONFIG_H
|
|
|
27 |
#include <config.h>
|
|
|
28 |
#endif
|
|
|
29 |
|
26 |
|
30 |
#include "mime.h"
|
27 |
#include "mime.h"
|
31 |
#include "mime-utils.h"
|
28 |
#include "mime-utils.h"
|
32 |
#include "mime-inputsource.h"
|
29 |
#include "mime-inputsource.h"
|
33 |
|
30 |
|
34 |
#include "convert.h"
|
31 |
#include <string>
|
35 |
#include "iodevice.h"
|
|
|
36 |
#include "iofactory.h"
|
|
|
37 |
|
32 |
|
38 |
#include <string>
|
|
|
39 |
#include <vector>
|
|
|
40 |
#include <map>
|
|
|
41 |
#include <exception>
|
|
|
42 |
#include <iostream>
|
|
|
43 |
|
|
|
44 |
#include <string.h>
|
|
|
45 |
#include <ctype.h>
|
|
|
46 |
#include <stdio.h>
|
|
|
47 |
#include <errno.h>
|
|
|
48 |
|
|
|
49 |
#ifndef NO_NAMESPACES
|
|
|
50 |
using namespace ::std;
|
33 |
using namespace ::std;
|
51 |
#endif /* NO_NAMESPACES */
|
|
|
52 |
|
|
|
53 |
//------------------------------------------------------------------------
|
|
|
54 |
void Binc::MimePart::printBody(IODevice &output,
|
|
|
55 |
unsigned int startoffset,
|
|
|
56 |
unsigned int length) const
|
|
|
57 |
{
|
|
|
58 |
mimeSource->reset();
|
|
|
59 |
mimeSource->seek(bodystartoffsetcrlf + startoffset);
|
|
|
60 |
|
|
|
61 |
if (startoffset + length > bodylength)
|
|
|
62 |
length = bodylength - startoffset;
|
|
|
63 |
|
|
|
64 |
char c = '\0';
|
|
|
65 |
for (unsigned int i = 0; i < length; ++i) {
|
|
|
66 |
if (!mimeSource->getChar(&c))
|
|
|
67 |
break;
|
|
|
68 |
|
|
|
69 |
output << (char)c;
|
|
|
70 |
}
|
|
|
71 |
}
|
|
|
72 |
|
34 |
|
73 |
void Binc::MimePart::getBody(string &s,
|
35 |
void Binc::MimePart::getBody(string &s,
|
74 |
unsigned int startoffset,
|
36 |
unsigned int startoffset,
|
75 |
unsigned int length) const
|
37 |
unsigned int length) const
|
76 |
{
|
38 |
{
|