blob: 62be61e75326336f6714dcf8877a7786472777e0 [file] [log] [blame]
Ethan Nicholas0df1b042017-03-31 13:56:23 -04001/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SKSL_OUTPUTSTREAM
9#define SKSL_OUTPUTSTREAM
10
11#include "SkSLString.h"
12
13namespace SkSL {
14
15class OutputStream {
16public:
17 virtual bool isValid() const {
18 return true;
19 }
20
21 virtual void write8(uint8_t b) = 0;
22
23 virtual void writeText(const char* s) = 0;
24
25 virtual void write(const void* s, size_t size) = 0;
26
27 void writeString(String s) {
28 this->write(s.c_str(), s.size());
29 }
30
31 virtual ~OutputStream() {}
32};
33
34} // namespace
35
36#endif