AWS SDK for C++  1.8.7
AWS SDK for C++
SimpleStreamBuf.h
Go to the documentation of this file.
1 
7 #pragma once
8 
12 #include <streambuf>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Stream
19 {
23  class AWS_CORE_API SimpleStreamBuf : public std::streambuf
24  {
25  public:
26 
27  using base = std::streambuf;
28 
30  explicit SimpleStreamBuf(const Aws::String& value);
31 
32  SimpleStreamBuf(const SimpleStreamBuf&) = delete;
33  SimpleStreamBuf& operator=(const SimpleStreamBuf&) = delete;
34 
35  SimpleStreamBuf(SimpleStreamBuf&& toMove) = delete;
36  SimpleStreamBuf& operator=(SimpleStreamBuf&&) = delete;
37 
38  virtual ~SimpleStreamBuf();
39 
40  Aws::String str() const;
41  void str(const Aws::String& value);
42 
43  void swap(SimpleStreamBuf& rhs);
44 
45  protected:
46  virtual 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;
47  virtual std::streampos seekpos(std::streampos pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override;
48 
49  virtual int overflow (int c = EOF) override;
50  virtual int underflow() override;
51 
52  virtual std::streamsize xsputn(const char* s, std::streamsize n) override;
53 
54  private:
55 
56  bool GrowBuffer();
57 
58  char* m_buffer;
59  size_t m_bufferSize;
60  };
61 
62 }
63 }
64 }
int which
Definition: cJSON.h:233
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25