27 if (allIsParsed || headerIsParsed)
30 headerIsParsed =
true;
58 memset(cqueue, 0,
sizeof(cqueue));
73 if (c ==
'\n') ++nlines;
76 for (
int i = name.length() - 1; i >= 0; --i)
86 if (name.length() == 2 && name.substr(0, 2) ==
"\r\n") {
93 if (name.length() == 1 && name[0] ==
'\r') {
106 if (c ==
'\n') ++nlines;
108 for (
int i = 0; i < 3; ++i)
109 cqueue[i] = cqueue[i + 1];
112 if (strncmp(cqueue,
"\r\n\r\n", 4) == 0) {
117 if (cqueue[2] ==
'\n') {
120 if (!isspace(cqueue[3])) {
121 if (content.length() > 2)
122 content.resize(content.length() - 2);
125 h.add(name, content);
137 if (content.length() > 2)
138 content.resize(content.length() - 2);
139 h.add(name, content);
void parseOnlyHeader(int fd) const
unsigned int headerstartoffsetcrlf
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")