#include "IMFHeaderField.h" #include "Exception.h" #include "Log.h" #include #include namespace coreutils { IMFHeaderField::IMFHeaderField(char &ch, int fd) { int rc = 0; while(((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')) || ((ch >= '0') && (ch <= '9')) || (ch == '-') || (ch == '_')) { key.write(ch); rc = ::read(fd, &ch, 1); } if(ch != ':') throw coreutils::Exception("expecting ':' in data stream."); rc = ::read(fd, &ch, 1); while(ch == ' ') rc = ::read(fd, &ch, 1); while(ch != '\r') { value.write(ch); rc = ::read(fd, &ch, 1); } rc = ::read(fd, &ch, 1); if(ch != '\n') throw coreutils::Exception("expecting '\n' in data stream."); rc = ::read(fd, &ch, 1); } }