29 lines
502 B
C++
29 lines
502 B
C++
#pragma once
|
|
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
|
|
class Response {
|
|
public:
|
|
enum Status {
|
|
ok,
|
|
notFound,
|
|
error
|
|
};
|
|
|
|
Response(const std::string_view& path);
|
|
|
|
void writeHeader(std::ostream& out) const;
|
|
void writeBody(std::ostream& out) const;
|
|
|
|
private:
|
|
void selfIndentification(const std::vector<std::string_view>& path);
|
|
|
|
static std::vector<std::string_view> splitPath(std::string_view path);
|
|
|
|
private:
|
|
Status status;
|
|
std::string body;
|
|
};
|