OTest2
A C++ testing framework
base64buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2__LIB_BASE64BUFFER_H_
21 #define OTest2__LIB_BASE64BUFFER_H_
22 
23 #include <streambuf>
24 
25 namespace OTest2 {
26 
30 class Base64Buffer : public std::streambuf {
31  private:
32  struct Impl;
33  Impl* pimpl;
34 
35  public:
45  explicit Base64Buffer(
46  std::streambuf* decorated_,
47  int width_);
48 
52  virtual ~Base64Buffer();
53 
54  /* -- avoid copying */
56  const Base64Buffer&) = delete;
58  const Base64Buffer&) = delete;
59 
68  bool close() noexcept;
69 
70  private:
71  /* -- streambuf interface */
72  virtual int overflow(
73  int c);
74 
75  bool finishOutputData();
76 };
77 
78 } /* -- namespace OTest2 */
79 
80 #endif /* -- OTest2__LIB_BASE64BUFFER_H_ */
OTest2::Base64Buffer
Base64 stream buffer.
Definition: base64buffer.h:30
OTest2::Base64Buffer::close
bool close() noexcept
Close currently opened sequence.
OTest2::Base64Buffer::Base64Buffer
Base64Buffer(std::streambuf *decorated_, int width_)
Ctor.
OTest2
Definition: assertbean.h:25
OTest2::Base64Buffer::~Base64Buffer
virtual ~Base64Buffer()
Dtor.
OTest2::Base64Buffer::operator=
Base64Buffer & operator=(const Base64Buffer &)=delete