Many additions and changes.
This commit is contained in:
1 parent
50f6e972de
commit
08169b1c3d
30 files changed
+451
-63
No files matched your search
+16
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user