PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
OutputStream.h
1
7#ifndef AUX_OUTPUT_STREAM_H
8#define AUX_OUTPUT_STREAM_H
9
10#include "basedefs.h"
11
12namespace PoDoFo {
13
17class PODOFO_API OutputStream
18{
19public:
21 virtual ~OutputStream();
22
27 void Write(char ch);
28
33 void Write(const std::string_view& view);
34
40 void Write(const char* buffer, size_t size);
41
42 void Flush();
43
44protected:
45 static void WriteBuffer(OutputStream& stream, const char* buffer, size_t size);
46 static void Flush(OutputStream& stream);
47
48protected:
49 virtual void writeBuffer(const char* buffer, size_t size) = 0;
50 virtual void flush();
51
55 virtual void checkWrite() const;
56
57private:
58 OutputStream(const OutputStream&) = delete;
59 OutputStream& operator=(const OutputStream&) = delete;
60};
61
62};
63
64#endif // AUX_OUTPUT_STREAM_H
An interface for writing blocks of data to a data source.
Definition OutputStream.h:18
void Write(const std::string_view &view)
Write the view to the OutputStream.
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16