Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/fuzzing/NullOStream.h
blob: fc13777b33eb7a0db1ab867c6fe8cc3063f79698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <iostream>

// from https://stackoverflow.com/a/8244052
class NullStreambuf : public std::streambuf {
  char dummyBuffer[64];

protected:
  virtual int overflow(int c) override final;
};

class NullOStream final : private NullStreambuf, public std::ostream {
public:
  NullOStream() : std::ostream(this) {}
  NullStreambuf *rdbuf() { return this; }
  virtual void avoidOutOfLineVirtualCompilerWarning();
};