37 lines
1001 B
C++
37 lines
1001 B
C++
#include "IMFHeader.h"
|
|
#include "Exception.h"
|
|
#include "Log.h"
|
|
#include <iostream>
|
|
|
|
namespace coreutils {
|
|
|
|
IMFHeader::IMFHeader(ZString &in) : ZString(in) {
|
|
|
|
key = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_0123456789");
|
|
std::cout << "key: [" << key << "]" << std::endl;
|
|
if(key.getLength() != 0) {
|
|
if(!in.ifNext(":"))
|
|
throw coreutils::Exception("Invalid character in expected header token.");
|
|
in.skipWhitespace();
|
|
value = in.goeolwithContinuation();
|
|
std::cout << "header: [" << value << "]" << std::endl;
|
|
}
|
|
else if(in.skipWhitespace() > 0) {}
|
|
else if(in.str() == "") {}
|
|
}
|
|
|
|
IMFHeader::IMFHeader(ZString key, ZString value) : ZString(), key(key), value(value) {}
|
|
|
|
ZString IMFHeader::getKey() {
|
|
return key;
|
|
}
|
|
|
|
ZString IMFHeader::getValue() {
|
|
return value;
|
|
}
|
|
|
|
void IMFHeader::output(std::stringstream &out) {
|
|
out << key << ": " << value << "\r\n";
|
|
}
|
|
|
|
} |