Initial repository load.
This commit is contained in:
commit
604e196fbb
32 files changed
+945
No files matched your search
@@ -0,0 +1,48 @@
|
||||
#include "IMFRequest.h"
|
||||
#include "Exception.h"
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
IMFRequest::IMFRequest() {}
|
||||
|
||||
IMFRequest::IMFRequest(PString &in) {
|
||||
method = in.getTokenExclude(" ");
|
||||
if(!in.ifNext(" "))
|
||||
throw core::Exception("Expecting space after method.");
|
||||
uri = in.getTokenExclude(" ");
|
||||
if(!in.ifNext(" "))
|
||||
throw core::Exception("Expecting space after URI.");
|
||||
protocol = in.getTokenExclude("\r\n");
|
||||
if(!in.ifNext("\r\n"))
|
||||
throw core::Exception("Expecting CRLF after protocol.");
|
||||
}
|
||||
|
||||
std::string IMFRequest::getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
void IMFRequest::setMethod(std::string method) {
|
||||
this->method = method;
|
||||
}
|
||||
|
||||
std::string IMFRequest::getURI() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
void IMFRequest::setURI(std::string uri) {
|
||||
this->uri = uri;
|
||||
}
|
||||
|
||||
std::string IMFRequest::getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
|
||||
void IMFRequest::setProtocol(std::string protocol) {
|
||||
this->protocol = protocol;
|
||||
}
|
||||
|
||||
void IMFRequest::output(std::stringstream &out) {
|
||||
out << method << " " << uri << " " << protocol << "\r\n";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user