You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
745 B
C++
46 lines
745 B
C++
#ifndef WEBCC_RESPONSE_H_
|
|
#define WEBCC_RESPONSE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "webcc/message.h"
|
|
|
|
namespace webcc {
|
|
|
|
class Response : public Message {
|
|
public:
|
|
explicit Response(Status status = Status::kOK) : status_(status) {
|
|
}
|
|
|
|
~Response() override = default;
|
|
|
|
int status() const {
|
|
return status_;
|
|
}
|
|
|
|
void set_status(int status) {
|
|
status_ = status;
|
|
}
|
|
|
|
const std::string& reason() const {
|
|
return reason_;
|
|
}
|
|
|
|
void set_reason(const std::string& reason) {
|
|
reason_ = reason;
|
|
}
|
|
|
|
void Prepare() override;
|
|
|
|
private:
|
|
int status_; // Status code
|
|
std::string reason_; // Reason phrase
|
|
};
|
|
|
|
using ResponsePtr = std::shared_ptr<Response>;
|
|
|
|
} // namespace webcc
|
|
|
|
#endif // WEBCC_RESPONSE_H_
|