46 lines
916 B
C++
46 lines
916 B
C++
#include "IMFMultipart.h"
|
|
#include "Log.h"
|
|
|
|
#include <unistd.h>
|
|
|
|
namespace coreutils {
|
|
|
|
IMFMultipart::IMFMultipart(int fd, MString boundary) {
|
|
int ch = 0;
|
|
int rc = 0;
|
|
std::cout << "020" << std::endl;
|
|
while((ch != '\r') && (ch != '\n')) {
|
|
rc = ::read(fd, &ch, 1);
|
|
if((ch != '\r') && (ch != '\n'))
|
|
std::cout << (char)ch;
|
|
boundary.write(ch);
|
|
}
|
|
if(ch == '\r') {
|
|
std::cout << std::endl;
|
|
rc = ::read(fd, &ch, 1);
|
|
}
|
|
while(1) {
|
|
std::cout << "021: " << boundary << std::endl;
|
|
IMFFormData *formData = new IMFFormData(fd, boundary);
|
|
std::cout << "022" << std::endl;
|
|
|
|
rc = ::read(fd, &ch, 1);
|
|
if(ch == '-') {
|
|
rc = ::read(fd, &ch, 1);
|
|
if(ch == '-') {
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
rc = ::read(fd, &ch, 1);
|
|
if(ch == '\r') {
|
|
rc = ::read(fd, &ch, 1);
|
|
if(ch == '\n') {
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|