Continued refinement of IMF objects.

This commit is contained in:
barant committed 2020-05-04 10:02:52 -07:00
1 parent 018c130df1
commit f4496fc682
2 files changed
+19 -9

No files matched your search

+16 -7
View File
@@ -9,14 +9,23 @@ namespace coreutils {
IMFHeader::IMFHeader(PString &in) {
key = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-");
if(!in.ifNext(":")) {
printf("%02X\n", in.str()[0]);
throw coreutils::Exception("Invalid character in expected header token.");
if(key.length() != 0) {
if(!in.ifNext(":")) {
printf("%02X\n", in.str()[0]);
throw coreutils::Exception("Invalid character in expected header token.");
}
in.skipWhitespace();
value = in.str();
}
in.skipWhitespace();
value = in.getTokenExclude("\r\n");
if(!in.ifNext("\r\n"))
throw coreutils::Exception("Expected CRLF.");
else if(in.skipWhitespace() > 0) {
}
else if(in.str() == "") {
}
}
IMFHeader::IMFHeader(std::string key, std::string value) {