AWS SDK for C++  1.8.5
AWS SDK for C++
SimpleStringStream.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
11 
12 #include <iostream>
13 
14 namespace Aws
15 {
16 
17 class AWS_CORE_API SimpleStringStream : public std::iostream
18 {
19  public:
20 
21  using char_type = char;
22  using traits_type = std::char_traits<char>;
24  using int_type = int;
25  using pos_type = std::streampos;
26  using off_type = std::streamoff;
27 
28  using base = std::iostream;
29 
31  SimpleStringStream(const Aws::String& value);
32 
33  virtual ~SimpleStringStream() {}
34 
35  // disabling copies of course
36  SimpleStringStream(const SimpleStringStream& rhs) = delete;
37  SimpleStringStream& operator=(const SimpleStringStream& rhs) = delete;
38 
39  // also disabling moves until there's a valid need
40  SimpleStringStream(SimpleStringStream&& rhs) = delete;
41  SimpleStringStream& operator=(SimpleStringStream&& rhs) = delete;
42 
43  Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
44 
45  Aws::String str() const { return m_streamBuffer.str(); }
46  void str(const Aws::String& value);
47 
48  private:
49 
51 };
52 
53 class AWS_CORE_API SimpleIStringStream : public std::istream
54 {
55  public:
56 
57  using char_type = char;
58  using traits_type = std::char_traits<char>;
60  using int_type = int;
61  using pos_type = std::streampos;
62  using off_type = std::streamoff;
63 
64  using base = std::istream;
65 
67  SimpleIStringStream(const Aws::String& value);
68 
69  virtual ~SimpleIStringStream() {}
70 
71  // disabling copies of course
72  SimpleIStringStream(const SimpleIStringStream& rhs) = delete;
73  SimpleIStringStream& operator=(const SimpleIStringStream& rhs) = delete;
74 
75  // also disabling moves until there's a valid need
77  SimpleIStringStream& operator=(SimpleIStringStream&& rhs) = delete;
78 
79  Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
80 
81  Aws::String str() const { return m_streamBuffer.str(); }
82  void str(const Aws::String& value);
83 
84  private:
85 
87 };
88 
89 class AWS_CORE_API SimpleOStringStream : public std::ostream
90 {
91  public:
92 
93  using char_type = char;
94  using traits_type = std::char_traits<char>;
96  using int_type = int;
97  using pos_type = std::streampos;
98  using off_type = std::streamoff;
99 
100  using base = std::ostream;
101 
103  SimpleOStringStream(const Aws::String& value);
104 
105  virtual ~SimpleOStringStream() {}
106 
107  // disabling copies of course
108  SimpleOStringStream(const SimpleOStringStream& rhs) = delete;
109  SimpleOStringStream& operator=(const SimpleOStringStream& rhs) = delete;
110 
111  // also disabling moves until there's a valid need
113  SimpleOStringStream& operator=(SimpleOStringStream&& rhs) = delete;
114 
115  Aws::Utils::Stream::SimpleStreamBuf* rdbuf() const { return const_cast<Aws::Utils::Stream::SimpleStreamBuf*>(&m_streamBuffer); }
116 
117  Aws::String str() const { return m_streamBuffer.str(); }
118  void str(const Aws::String& value);
119 
120  private:
121 
123 };
124 
125 } // namespace Aws
126 
Aws::Allocator< char > allocator_type
Aws::Utils::Stream::SimpleStreamBuf * rdbuf() const
std::char_traits< char > traits_type
std::allocator< T > Allocator
Definition: AWSAllocator.h:84
Aws::Utils::Stream::SimpleStreamBuf * rdbuf() const
Aws::String str() const
Aws::Utils::Stream::SimpleStreamBuf * rdbuf() const
Aws::Allocator< char > allocator_type
Aws::String str() const
Aws::Allocator< char > allocator_type
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
std::char_traits< char > traits_type
std::char_traits< char > traits_type