mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 07:45:46 +00:00
31 lines
870 B
C++
31 lines
870 B
C++
#pragma once
|
|
#include "../Streams/Stream.hpp"
|
|
|
|
namespace Tesses::Framework::Http
|
|
{
|
|
class HttpStream : public Tesses::Framework::Streams::Stream {
|
|
std::shared_ptr<Tesses::Framework::Streams::Stream> strm;
|
|
|
|
size_t offset;
|
|
size_t read;
|
|
int64_t length;
|
|
int64_t position;
|
|
|
|
bool recv;
|
|
bool http1_1;
|
|
|
|
bool done;
|
|
|
|
public:
|
|
HttpStream(std::shared_ptr<Tesses::Framework::Streams::Stream> strm, int64_t length, bool recv, bool http1_1);
|
|
bool CanRead();
|
|
bool CanWrite();
|
|
bool EndOfStream();
|
|
int64_t GetLength();
|
|
int64_t GetPosition();
|
|
size_t Read(uint8_t* buffer, size_t len);
|
|
size_t Write(const uint8_t* buffer, size_t len);
|
|
void Close();
|
|
~HttpStream();
|
|
};
|
|
} |