Many additions and changes.

This commit is contained in:
barant committed 2019-09-13 10:29:36 -07:00
1 parent 50f6e972de
commit 08169b1c3d
30 files changed
+451 -63

No files matched your search

+16 -3
View File
@@ -12,6 +12,9 @@ namespace coreutils {
}
void IMFMessage::parse(PString &in) {
if(in.size() == 0)
return;
while(!in.ifNext("\r\n"))
headers.emplace_back(in);
@@ -55,16 +58,26 @@ namespace coreutils {
}
std::string IMFMessage::getHeaderKeyPairValue(std::string headerKey, std::string key) {
std::string value;
coreutils::PString psource(getHeader(headerKey, false));
std::vector<PString> sourcep = psource.split(";");
for(PString work: sourcep) {
work.skipWhitespace();
std::string token = work.getTokenExclude("=");
if(work.ifNext("=")) {
if(token == key)
return work.str();
if(token == key) {
if(work.ifNext("\"")) {
value = work.getTokenExclude("\"");
return value;
}
else {
value = work.str();
return value;
}
}
else
continue;
continue;
} else if (work.ifNext(";") || work.ifNext(" ")) {
if(token == key)