Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
httpresponsewriter.h
Go to the documentation of this file.
1
#pragma once
2
#ifndef HTTP_HTTPRESPONSEWRITER_H
3
#define HTTP_HTTPRESPONSEWRITER_H
4
//------------------------------------------------------------------------------
14
#include "
io/streamwriter.h
"
15
#include "
http/httpstatus.h
"
16
17
//------------------------------------------------------------------------------
18
namespace
Http
19
{
20
class
HttpResponseWriter
:
public
IO::StreamWriter
21
{
22
__DeclareClass
(
HttpResponseWriter
);
23
public
:
25
void
SetStatusCode
(
HttpStatus::Code
statusCode
);
27
void
SetContent
(
const
Ptr<IO::Stream>
&
contentStream
);
29
void
WriteResponse
();
30
31
private
:
32
HttpStatus::Code
statusCode
;
33
Ptr<IO::Stream>
contentStream
;
34
};
35
36
//------------------------------------------------------------------------------
39
inline
void
40
HttpResponseWriter::SetStatusCode
(
HttpStatus::Code
c)
41
{
42
this->
statusCode
= c;
43
}
44
45
//------------------------------------------------------------------------------
48
inline
void
49
HttpResponseWriter::SetContent
(
const
Ptr<IO::Stream>
& s)
50
{
51
this->
contentStream
= s;
52
}
53
54
}
55
//------------------------------------------------------------------------------
56
#endif
Http::HttpResponseWriter
Stream writer which writes a correct HTTP response to a stream.
Definition
httpresponsewriter.h:21
Http::HttpResponseWriter::statusCode
HttpStatus::Code statusCode
Definition
httpresponsewriter.h:32
Http::HttpResponseWriter::WriteResponse
void WriteResponse()
write http response to the stream
Definition
httpresponsewriter.cc:20
Http::HttpResponseWriter::__DeclareClass
__DeclareClass(HttpResponseWriter)
Http::HttpResponseWriter::SetStatusCode
void SetStatusCode(HttpStatus::Code statusCode)
set status code
Definition
httpresponsewriter.h:40
Http::HttpResponseWriter::contentStream
Ptr< IO::Stream > contentStream
Definition
httpresponsewriter.h:33
Http::HttpResponseWriter::SetContent
void SetContent(const Ptr< IO::Stream > &contentStream)
set optional content stream (needs valid media type!)
Definition
httpresponsewriter.h:49
Http::HttpStatus::Code
Code
status codes
Definition
httpstatus.h:24
IO::StreamWriter
Stream writer classes provide a specialized write-interface for a stream.
Definition
streamwriter.h:22
Ptr
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition
ptr.h:38
httpstatus.h
Http
This file was generated with Nebula Trifid's idlc compiler tool.
Definition
defaulthttprequesthandler.cc:15
streamwriter.h
code
foundation
http
httpresponsewriter.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.