AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
EventStreamBuf.h
1
5#pragma once
6
7#include <aws/core/Core_EXPORTS.h>
8#include <ios>
9#include <aws/core/utils/event/EventStreamDecoder.h>
10#include <aws/core/utils/memory/stl/AWSStringStream.h>
11
12namespace Aws
13{
14 namespace Utils
15 {
16 namespace Event
17 {
18 extern AWS_CORE_API const size_t DEFAULT_BUF_SIZE;
19
24 class AWS_CORE_API EventStreamBuf : public std::streambuf
25 {
26 public:
31 EventStreamBuf(EventStreamDecoder& decoder, size_t bufferLength = DEFAULT_BUF_SIZE);
32 virtual ~EventStreamBuf();
33
34 protected:
35 std::streampos seekoff(std::streamoff off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
36 std::streampos seekpos(std::streampos pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
37
38 int underflow() override;
39 int overflow(int ch) override;
40 int sync() override;
41
42 private:
43 void writeToDecoder();
44
45 ByteBuffer m_byteBuffer;
46 size_t m_bufferLength;
48 EventStreamDecoder& m_decoder;
49 };
50 }
51 }
52}
std::streampos seekoff(std::streamoff off, std::ios_base::seekdir dir, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override
int overflow(int ch) override
EventStreamBuf(EventStreamDecoder &decoder, size_t bufferLength=DEFAULT_BUF_SIZE)
std::streampos seekpos(std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override
AWS_CORE_API const size_t DEFAULT_BUF_SIZE
std::basic_stringstream< char, std::char_traits< char >, Aws::Allocator< char > > StringStream