29 vector<string> headers,
bool includeheaders,
30 unsigned int startoffset,
31 unsigned int length,
string &store)
const
43 memset(cqueue, 0,
sizeof(cqueue));
48 unsigned int wrotebytes = 0;
49 unsigned int processedbytes = 0;
50 bool hasHeaderSeparator =
false;
71 hasHeaderSeparator =
true;
78 for (
int i = name.length(); i >= 0; --i)
101 cqueue[0] = cqueue[1];
105 if (cqueue[0] ==
'\n' && cqueue[1] !=
'\t' && cqueue[1] !=
' ') {
111 string lowername = name;
113 trim(lowername,
": \t");
114 bool foundMatch =
false;
116 for (vector<string>::const_iterator i = headers.begin();
117 i != headers.end(); ++i) {
120 if (nametmp == lowername) {
126 if (foundMatch == includeheaders || headers.size() == 0) {
127 string out = name + content;
128 for (string::const_iterator i = out.begin(); i != out.end(); ++i)
129 if (processedbytes >= startoffset && wrotebytes < length) {
130 if (processedbytes >= startoffset) {
148 string lowername = name;
150 trim(lowername,
": \t");
151 bool foundMatch =
false;
152 for (vector<string>::const_iterator i = headers.begin();
153 i != headers.end(); ++i) {
156 if (nametmp == lowername) {
162 if (hasHeaderSeparator || foundMatch == includeheaders || headers.size() == 0) {
163 string out = name + content;
164 for (string::const_iterator i = out.begin(); i != out.end(); ++i)
165 if (processedbytes >= startoffset && wrotebytes < length) {
The IODevice class provides a framework for reading and writing to device.
unsigned int headerstartoffsetcrlf
void printHeader(int fd, Binc::IODevice &output, std::vector< std::string > headers, bool includeheaders, unsigned int startoffset, unsigned int length, std::string &storage) const
Declaration of miscellaneous convertion functions.
Declaration of the IODevice class.
Declaration of the IOFactory class.
Declaration of main mime parser components.
void lowercase(std::string &input)
void trim(std::string &s_in, const std::string &chars=" \t\r\n")