27 if (allIsParsed || headerIsParsed)
30 headerIsParsed =
true;
59 memset(cqueue, 0,
sizeof(cqueue));
74 if (c ==
'\n') ++nlines;
77 for (
int i = name.length() - 1; i >= 0; --i)
87 if (name.length() == 2 && name.substr(0, 2) ==
"\r\n") {
94 if (name.length() == 1 && name[0] ==
'\r') {
107 if (c ==
'\n') ++nlines;
109 for (
int i = 0; i < 3; ++i)
110 cqueue[i] = cqueue[i + 1];
113 if (strncmp(cqueue,
"\r\n\r\n", 4) == 0) {
118 if (cqueue[2] ==
'\n') {
121 if (!isspace(cqueue[3])) {
122 if (content.length() > 2)
123 content.resize(content.length() - 2);
126 h.add(name, content);
138 if (content.length() > 2)
139 content.resize(content.length() - 2);
140 h.add(name, content);
void parseOnlyHeader(int fd) const
unsigned int headerstartoffsetcrlf
virtual int parseOnlyHeader(const std::string &toboundary) const
unsigned int bodystartoffsetcrlf
unsigned int headerlength
Declaration of miscellaneous convertion functions.
Declaration of main mime parser components.
void trim(std::string &s_in, const std::string &chars=" \t\r\n")