Continued refinement of IMF objects.
This commit is contained in:
parent
018c130df1
commit
f4496fc682
@ -9,14 +9,23 @@ namespace coreutils {
|
||||
|
||||
IMFHeader::IMFHeader(PString &in) {
|
||||
key = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-");
|
||||
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.getTokenExclude("\r\n");
|
||||
if(!in.ifNext("\r\n"))
|
||||
throw coreutils::Exception("Expected CRLF.");
|
||||
value = in.str();
|
||||
}
|
||||
else if(in.skipWhitespace() > 0) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if(in.str() == "") {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IMFHeader::IMFHeader(std::string key, std::string value) {
|
||||
|
@ -76,8 +76,9 @@ namespace coreutils {
|
||||
return test;
|
||||
}
|
||||
|
||||
void PString::skipWhitespace() {
|
||||
cursor = pstring.find_first_not_of(" \t", cursor);
|
||||
int PString::skipWhitespace() {
|
||||
size_t found = pstring.find_first_not_of(" \t", cursor);
|
||||
return found != cursor::npos ? cursor + found: 0;
|
||||
}
|
||||
|
||||
int PString::size() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user