Initial setup
This commit is contained in:
parent
3a0fa57a06
commit
68e795f0e6
17 changed files with 466 additions and 8 deletions
11
stream/CMakeLists.txt
Normal file
11
stream/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
set(HEADERS
|
||||
stream.h
|
||||
ostream.h
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
stream.cpp
|
||||
ostream.cpp
|
||||
)
|
||||
|
||||
target_sources(pica PRIVATE ${SOURCES})
|
9
stream/ostream.cpp
Normal file
9
stream/ostream.cpp
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include "ostream.h"
|
||||
|
||||
OStream::OStream(FCGX_Stream* _raw):
|
||||
Stream(_raw),
|
||||
std(&raw)
|
||||
{
|
||||
}
|
||||
|
||||
OStream::~OStream() {}
|
24
stream/ostream.h
Normal file
24
stream/ostream.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include <ios>
|
||||
|
||||
#include "stream.h"
|
||||
|
||||
class Request;
|
||||
|
||||
class OStream : Stream {
|
||||
friend class Request;
|
||||
private:
|
||||
OStream(FCGX_Stream* raw);
|
||||
|
||||
public:
|
||||
~OStream();
|
||||
|
||||
template <typename T>
|
||||
OStream& operator << (const T& value) {
|
||||
std << value;
|
||||
return *this;
|
||||
};
|
||||
private:
|
||||
std::ostream std;
|
||||
};
|
8
stream/stream.cpp
Normal file
8
stream/stream.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include "stream.h"
|
||||
|
||||
Stream::Stream(FCGX_Stream* raw):
|
||||
raw(raw)
|
||||
{}
|
||||
|
||||
Stream::~Stream() {
|
||||
}
|
18
stream/stream.h
Normal file
18
stream/stream.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <fcgio.h>
|
||||
|
||||
class Stream {
|
||||
protected:
|
||||
Stream(FCGX_Stream* raw);
|
||||
Stream(const Stream& other) = delete;
|
||||
Stream(Stream&& other) = delete;
|
||||
Stream& operator = (const Stream& other) = delete;
|
||||
Stream& operator = (Stream&& other) = delete;
|
||||
virtual ~Stream();
|
||||
|
||||
public:
|
||||
|
||||
protected:
|
||||
fcgi_streambuf raw;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue