Initial repository load.
This commit is contained in:
commit
604e196fbb
32 files changed
+945
No files matched your search
@@ -0,0 +1,45 @@
|
||||
#include "IMFHeader.h"
|
||||
#include "Exception.h"
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
IMFHeader::IMFHeader() {
|
||||
|
||||
}
|
||||
|
||||
IMFHeader::IMFHeader(PString &in) {
|
||||
key = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-");
|
||||
if(!in.ifNext(":"))
|
||||
throw core::Exception("Invalid character in expected header token.");
|
||||
in.skipWhitespace();
|
||||
value = in.getTokenExclude("\r\n");
|
||||
if(!in.ifNext("\r\n"))
|
||||
throw core::Exception("Expected CRLF.");
|
||||
}
|
||||
|
||||
IMFHeader::IMFHeader(std::string key, std::string value) {
|
||||
this->key = key;
|
||||
this->value = value;
|
||||
}
|
||||
|
||||
std::string IMFHeader::getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
void IMFHeader::setKey(std::string key) {
|
||||
this->key = key;
|
||||
}
|
||||
|
||||
std::string IMFHeader::getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
void IMFHeader::setValue(std::string value) {
|
||||
this->value = value;
|
||||
}
|
||||
|
||||
void IMFHeader::output(std::stringstream &out) {
|
||||
out << key << ": " << value << "\r\n";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user