blob: 31ed7bc6d4140c21df3f6f63e0ccc6880a7ce487 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00003 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00004 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00006 */
7
8#ifndef SkStream_DEFINED
9#define SkStream_DEFINED
10
11#include "SkRefCnt.h"
12#include "SkScalar.h"
13
reed@google.com8d0b5772011-06-24 13:07:31 +000014class SkData;
reed@google.com70442a62011-06-23 21:48:04 +000015
bungeman@google.com6cab1a42013-05-29 13:43:31 +000016class SkStream;
17class SkStreamRewindable;
18class SkStreamSeekable;
19class SkStreamAsset;
20class SkStreamMemory;
21
reed@google.com3b345052013-05-07 15:59:16 +000022/**
23 * SkStream -- abstraction for a source of bytes. Subclasses can be backed by
24 * memory, or a file, or something else.
25 *
26 * NOTE:
27 *
28 * Classic "streams" APIs are sort of async, in that on a request for N
29 * bytes, they may return fewer than N bytes on a given call, in which case
30 * the caller can "try again" to get more bytes, eventually (modulo an error)
31 * receiving their total N bytes.
skia.committer@gmail.com2b34fe02013-05-08 07:01:40 +000032 *
reed@google.com3b345052013-05-07 15:59:16 +000033 * Skia streams behave differently. They are effectively synchronous, and will
34 * always return all N bytes of the request if possible. If they return fewer
35 * (the read() call returns the number of bytes read) then that means there is
36 * no more data (at EOF or hit an error). The caller should *not* call again
37 * in hopes of fulfilling more of the request.
38 */
bungeman@google.com6cab1a42013-05-29 13:43:31 +000039class SK_API SkStream : public SkRefCnt { //TODO: remove SkRefCnt
reed@android.com8a1c16f2008-12-17 15:59:43 +000040public:
reed@google.come1575aa2013-03-18 21:08:46 +000041 /**
42 * Attempts to open the specified file, and return a stream to it (using
43 * mmap if available). On success, the caller must call unref() on the
44 * returned object. On failure, returns NULL.
45 */
bungeman@google.com6cab1a42013-05-29 13:43:31 +000046 static SkStreamAsset* NewFromFile(const char path[]);
skia.committer@gmail.com8eaddb02013-03-19 07:15:10 +000047
robertphillips@google.com15e9d3e2012-06-21 20:25:03 +000048 SK_DECLARE_INST_COUNT(SkStream)
49
bungeman@google.com6cab1a42013-05-29 13:43:31 +000050 /** Reads or skips size number of bytes.
51 * If buffer == NULL, skip size bytes, return how many were skipped.
52 * If buffer != NULL, copy size bytes into buffer, return how many were copied.
53 * @param buffer when NULL skip size bytes, otherwise copy size bytes into buffer
54 * @param size the number of bytes to skip or copy
55 * @return bytes read on success
56 */
reed@android.com8a1c16f2008-12-17 15:59:43 +000057 virtual size_t read(void* buffer, size_t size) = 0;
58
bungeman@google.com6cab1a42013-05-29 13:43:31 +000059 /** Skip size number of bytes.
60 * @return the actual number bytes that could be skipped.
61 */
62 size_t skip(size_t size) {
63 //return this->read(NULL, size);
64 //TODO: remove this old logic after updating existing implementations
65 return 0 == size ? 0 : this->read(NULL, size);
66 }
rmistry@google.comfbfcd562012-08-23 18:09:54 +000067
bungeman@google.com6cab1a42013-05-29 13:43:31 +000068 /** Returns true if there are no more bytes to be read.
69 * In Progress: do not use until all implementations are updated.
70 * TODO: after this is implemented everywhere, make pure virtual.
71 */
72 virtual bool isAtEnd() const {
73 SkASSERT(false);
74 return true;
75 }
reed@android.com8a1c16f2008-12-17 15:59:43 +000076
77 int8_t readS8();
78 int16_t readS16();
79 int32_t readS32();
80
81 uint8_t readU8() { return (uint8_t)this->readS8(); }
82 uint16_t readU16() { return (uint16_t)this->readS16(); }
83 uint32_t readU32() { return (uint32_t)this->readS32(); }
84
85 bool readBool() { return this->readU8() != 0; }
86 SkScalar readScalar();
87 size_t readPackedUInt();
robertphillips@google.com15e9d3e2012-06-21 20:25:03 +000088
reed@google.com2e079422012-07-02 19:35:13 +000089 /**
epoger@google.com8e3fb2d2013-03-20 15:56:03 +000090 * Reconstitute an SkData object that was written to the stream
91 * using SkWStream::writeData().
reed@google.com2e079422012-07-02 19:35:13 +000092 */
93 SkData* readData();
94
bungeman@google.com6cab1a42013-05-29 13:43:31 +000095//SkStreamRewindable
96 /** Rewinds to the beginning of the stream. If this cannot be done, return false. */
97 virtual bool rewind() { return false; }
98
99 /** Duplicates this stream. If this cannot be done, returns NULL.
100 * The returned stream will be positioned at the beginning of its data.
101 */
102 virtual SkStreamRewindable* duplicate() const { return NULL; }
103
104//SkStreamSeekable
105 /** Returns true if this stream can report it's current position. */
106 virtual bool hasPosition() const { return false; }
107 /** Returns the current position in the stream. If this cannot be done, returns 0. */
108 virtual size_t getPosition() const { return 0; }
109
110 /** Seeks to an absolute position in the stream. If this cannot be done, returns false.
111 * If an attempt is made to seek past the end of the stream, the position will be set
112 * to the end of the stream.
113 */
114 virtual bool seek(size_t position) { return false; }
115
116 /** Seeks to an relative offset in the stream. If this cannot be done, returns false.
117 * If an attempt is made to move to a position outside the stream, the position will be set
118 * to the closest point within the stream (beginning or end).
119 */
120 virtual bool move(long offset) { return false; }
121
122 /** Duplicates this stream. If this cannot be done, returns NULL.
123 * The returned stream will be positioned the same as this stream.
124 */
125 virtual SkStreamSeekable* fork() const { return NULL; }
126
127//SkStreamAsset
128 /** Returns true if this stream can report it's total length. */
129 virtual bool hasLength() const { return false; }
130 /** Returns the total length of the stream. If this cannot be done, returns 0. */
131 virtual size_t getLength() const {
132 //return 0;
133 //TODO: remove the following after everyone is updated.
134 return ((SkStream*)this)->read(NULL, 0);
135 }
136
137//SkStreamMemory
138 /** Returns the starting address for the data. If this cannot be done, returns NULL. */
139 //TODO: replace with virtual const SkData* getData()
140 virtual const void* getMemoryBase() { return NULL; }
141
robertphillips@google.com15e9d3e2012-06-21 20:25:03 +0000142private:
143 typedef SkRefCnt INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000144};
145
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000146/** SkStreamRewindable is a SkStream for which rewind and duplicate are required. */
147class SK_API SkStreamRewindable : public SkStream {
148public:
149 //TODO: remove the following after everyone is updated (ensures new behavior on new classes).
150 virtual bool isAtEnd() const SK_OVERRIDE = 0;
151 //TODO: remove the following after everyone is updated (ensures new behavior on new classes).
152 virtual size_t getLength() const SK_OVERRIDE { return 0; }
153
154 virtual bool rewind() SK_OVERRIDE = 0;
155 virtual SkStreamRewindable* duplicate() const SK_OVERRIDE = 0;
156};
157
158/** SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required. */
159class SK_API SkStreamSeekable : public SkStreamRewindable {
160public:
161 virtual SkStreamSeekable* duplicate() const SK_OVERRIDE = 0;
162
163 virtual bool hasPosition() const SK_OVERRIDE { return true; }
164 virtual size_t getPosition() const SK_OVERRIDE = 0;
165 virtual bool seek(size_t position) SK_OVERRIDE = 0;
166 virtual bool move(long offset) SK_OVERRIDE = 0;
167 virtual SkStreamSeekable* fork() const SK_OVERRIDE = 0;
168};
169
170/** SkStreamAsset is a SkStreamSeekable for which getLength is required. */
171class SK_API SkStreamAsset : public SkStreamSeekable {
172public:
173 virtual SkStreamAsset* duplicate() const SK_OVERRIDE = 0;
174 virtual SkStreamAsset* fork() const SK_OVERRIDE = 0;
175
176 virtual bool hasLength() const SK_OVERRIDE { return true; }
177 virtual size_t getLength() const SK_OVERRIDE = 0;
178};
179
180/** SkStreamMemory is a SkStreamAsset for which getMemoryBase is required. */
181class SK_API SkStreamMemory : public SkStreamAsset {
182public:
183 virtual SkStreamMemory* duplicate() const SK_OVERRIDE = 0;
184 virtual SkStreamMemory* fork() const SK_OVERRIDE = 0;
185
186 virtual const void* getMemoryBase() SK_OVERRIDE = 0;
187};
188
ctguil@chromium.orgdfc5ffe2011-03-30 20:14:49 +0000189class SK_API SkWStream : SkNoncopyable {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000190public:
reed@google.com3b429982012-06-26 15:30:08 +0000191 SK_DECLARE_INST_COUNT_ROOT(SkWStream)
192
reed@android.com8a1c16f2008-12-17 15:59:43 +0000193 virtual ~SkWStream();
194
195 /** Called to write bytes to a SkWStream. Returns true on success
196 @param buffer the address of at least size bytes to be written to the stream
197 @param size The number of bytes in buffer to write to the stream
198 @return true on success
199 */
200 virtual bool write(const void* buffer, size_t size) = 0;
201 virtual void newline();
202 virtual void flush();
203
204 // helpers
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000205
reed@android.com8a1c16f2008-12-17 15:59:43 +0000206 bool write8(U8CPU);
207 bool write16(U16CPU);
208 bool write32(uint32_t);
209
210 bool writeText(const char text[]);
211 bool writeDecAsText(int32_t);
vandebo@chromium.orgd877fdb2010-10-12 23:08:13 +0000212 bool writeBigDecAsText(int64_t, int minDigits = 0);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000213 bool writeHexAsText(uint32_t, int minDigits = 0);
214 bool writeScalarAsText(SkScalar);
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000215
reed@android.com8a1c16f2008-12-17 15:59:43 +0000216 bool writeBool(bool v) { return this->write8(v); }
217 bool writeScalar(SkScalar);
218 bool writePackedUInt(size_t);
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000219
reed@android.com8a1c16f2008-12-17 15:59:43 +0000220 bool writeStream(SkStream* input, size_t length);
reed@google.com8a85d0c2011-06-24 19:12:12 +0000221
epoger@google.com8e3fb2d2013-03-20 15:56:03 +0000222 /**
223 * Append an SkData object to the stream, such that it can be read
224 * out of the stream using SkStream::readData().
225 *
226 * Note that the encoding method used to write the SkData object
227 * to the stream may change over time. This method DOES NOT
228 * just write the raw content of the SkData object to the stream.
229 */
reed@google.com8a85d0c2011-06-24 19:12:12 +0000230 bool writeData(const SkData*);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000231};
232
233////////////////////////////////////////////////////////////////////////////////////////
234
235#include "SkString.h"
236
237struct SkFILE;
238
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000239/** A stream that wraps a C FILE* file stream. */
240class SK_API SkFILEStream : public SkStreamAsset {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000241public:
reed@google.com3b429982012-06-26 15:30:08 +0000242 SK_DECLARE_INST_COUNT(SkFILEStream)
243
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000244 /** Initialize the stream by calling sk_fopen on the specified path.
245 * This internal stream will be closed in the destructor.
reed@android.com8a1c16f2008-12-17 15:59:43 +0000246 */
247 explicit SkFILEStream(const char path[] = NULL);
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000248
249 enum Ownership {
250 kCallerPasses_Ownership,
251 kCallerRetains_Ownership
252 };
253 /** Initialize the stream with an existing C file stream.
254 * While this stream exists, it assumes exclusive access to the C file stream.
255 * The C file stream will be closed in the destructor unless the caller specifies
256 * kCallerRetains_Ownership.
257 */
258 explicit SkFILEStream(FILE* file, Ownership ownership = kCallerPasses_Ownership);
259
reed@android.com8a1c16f2008-12-17 15:59:43 +0000260 virtual ~SkFILEStream();
261
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000262 /** Returns true if the current path could be opened. */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000263 bool isValid() const { return fFILE != NULL; }
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000264
265 /** Close the current file, and open a new file with the specified path.
266 * If path is NULL, just close the current file.
267 */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000268 void setPath(const char path[]);
269
tomhudson@google.com13413042011-10-03 16:01:10 +0000270 virtual size_t read(void* buffer, size_t size) SK_OVERRIDE;
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000271 virtual bool isAtEnd() const SK_OVERRIDE;
272
273 virtual bool rewind() SK_OVERRIDE;
274 virtual SkStreamAsset* duplicate() const SK_OVERRIDE;
275
276 virtual size_t getPosition() const SK_OVERRIDE;
277 virtual bool seek(size_t position) SK_OVERRIDE;
278 virtual bool move(long offset) SK_OVERRIDE;
279 virtual SkStreamAsset* fork() const SK_OVERRIDE;
280
281 virtual size_t getLength() const SK_OVERRIDE;
282
283 const void* getMemoryBase() SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000284
285private:
286 SkFILE* fFILE;
287 SkString fName;
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000288 Ownership fOwnership;
289 // fData is lazilly initialized when needed.
290 mutable SkAutoTUnref<SkData> fData;
reed@google.com3b429982012-06-26 15:30:08 +0000291
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000292 typedef SkStreamAsset INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000293};
294
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000295class SK_API SkMemoryStream : public SkStreamMemory {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000296public:
reed@google.com3b429982012-06-26 15:30:08 +0000297 SK_DECLARE_INST_COUNT(SkMemoryStream)
298
reed@android.com8a1c16f2008-12-17 15:59:43 +0000299 SkMemoryStream();
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000300
301 /** We allocate (and free) the memory. Write to it via getMemoryBase() */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000302 SkMemoryStream(size_t length);
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000303
304 /** If copyData is true, the stream makes a private copy of the data. */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000305 SkMemoryStream(const void* data, size_t length, bool copyData = false);
scroggo@google.come4904202013-01-09 22:02:58 +0000306
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000307 /** Use the specified data as the memory for this stream.
308 * The stream will call ref() on the data (assuming it is not NULL).
scroggo@google.come4904202013-01-09 22:02:58 +0000309 */
310 SkMemoryStream(SkData*);
311
reed@android.com8a1c16f2008-12-17 15:59:43 +0000312 virtual ~SkMemoryStream();
313
314 /** Resets the stream to the specified data and length,
315 just like the constructor.
316 if copyData is true, the stream makes a private copy of the data
317 */
318 virtual void setMemory(const void* data, size_t length,
319 bool copyData = false);
djsollen@google.com57f49692011-02-23 20:46:31 +0000320 /** Replace any memory buffer with the specified buffer. The caller
321 must have allocated data with sk_malloc or sk_realloc, since it
322 will be freed with sk_free.
323 */
324 void setMemoryOwned(const void* data, size_t length);
reed@google.com8a85d0c2011-06-24 19:12:12 +0000325
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000326 /** Return the stream's data in a SkData.
327 * The caller must call unref() when it is finished using the data.
reed@google.com8a85d0c2011-06-24 19:12:12 +0000328 */
329 SkData* copyToData() const;
330
331 /**
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000332 * Use the specified data as the memory for this stream.
333 * The stream will call ref() on the data (assuming it is not NULL).
334 * The function returns the data parameter as a convenience.
reed@google.com8a85d0c2011-06-24 19:12:12 +0000335 */
336 SkData* setData(SkData*);
337
reed@android.com8a1c16f2008-12-17 15:59:43 +0000338 void skipToAlign4();
reed@android.com8a1c16f2008-12-17 15:59:43 +0000339 const void* getAtPos();
reed@android.com8a1c16f2008-12-17 15:59:43 +0000340 size_t peek() const { return fOffset; }
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000341
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000342 virtual size_t read(void* buffer, size_t size) SK_OVERRIDE;
343 virtual bool isAtEnd() const SK_OVERRIDE;
344
345 virtual bool rewind() SK_OVERRIDE;
346 virtual SkMemoryStream* duplicate() const SK_OVERRIDE;
347
348 virtual size_t getPosition() const SK_OVERRIDE;
349 virtual bool seek(size_t position) SK_OVERRIDE;
350 virtual bool move(long offset) SK_OVERRIDE;
351 virtual SkMemoryStream* fork() const SK_OVERRIDE;
352
353 virtual size_t getLength() const SK_OVERRIDE;
354
355 virtual const void* getMemoryBase() SK_OVERRIDE;
356
reed@android.com8a1c16f2008-12-17 15:59:43 +0000357private:
reed@google.com8a85d0c2011-06-24 19:12:12 +0000358 SkData* fData;
359 size_t fOffset;
reed@google.com3b429982012-06-26 15:30:08 +0000360
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000361 typedef SkStreamMemory INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000362};
363
364/////////////////////////////////////////////////////////////////////////////////////////////
365
alokp@chromium.orgf7751ae2012-07-17 19:10:36 +0000366class SK_API SkFILEWStream : public SkWStream {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000367public:
reed@google.com3b429982012-06-26 15:30:08 +0000368 SK_DECLARE_INST_COUNT(SkFILEWStream)
369
370 SkFILEWStream(const char path[]);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000371 virtual ~SkFILEWStream();
372
373 /** Returns true if the current path could be opened.
374 */
375 bool isValid() const { return fFILE != NULL; }
376
tomhudson@google.com13413042011-10-03 16:01:10 +0000377 virtual bool write(const void* buffer, size_t size) SK_OVERRIDE;
378 virtual void flush() SK_OVERRIDE;
reed@google.com3b429982012-06-26 15:30:08 +0000379
reed@android.com8a1c16f2008-12-17 15:59:43 +0000380private:
381 SkFILE* fFILE;
reed@google.com3b429982012-06-26 15:30:08 +0000382
383 typedef SkWStream INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000384};
385
386class SkMemoryWStream : public SkWStream {
387public:
reed@google.com3b429982012-06-26 15:30:08 +0000388 SK_DECLARE_INST_COUNT(SkMemoryWStream)
389
reed@android.com8a1c16f2008-12-17 15:59:43 +0000390 SkMemoryWStream(void* buffer, size_t size);
tomhudson@google.com13413042011-10-03 16:01:10 +0000391 virtual bool write(const void* buffer, size_t size) SK_OVERRIDE;
junov@chromium.org1cc8f6f2012-02-22 21:00:42 +0000392 size_t bytesWritten() const { return fBytesWritten; }
393
reed@android.com8a1c16f2008-12-17 15:59:43 +0000394private:
395 char* fBuffer;
396 size_t fMaxLength;
397 size_t fBytesWritten;
reed@google.com3b429982012-06-26 15:30:08 +0000398
399 typedef SkWStream INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000400};
401
ctguil@chromium.orgdfc5ffe2011-03-30 20:14:49 +0000402class SK_API SkDynamicMemoryWStream : public SkWStream {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000403public:
reed@google.com3b429982012-06-26 15:30:08 +0000404 SK_DECLARE_INST_COUNT(SkDynamicMemoryWStream)
405
reed@android.com8a1c16f2008-12-17 15:59:43 +0000406 SkDynamicMemoryWStream();
407 virtual ~SkDynamicMemoryWStream();
reed@google.com8a85d0c2011-06-24 19:12:12 +0000408
tomhudson@google.com13413042011-10-03 16:01:10 +0000409 virtual bool write(const void* buffer, size_t size) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000410 // random access write
411 // modifies stream and returns true if offset + size is less than or equal to getOffset()
412 bool write(const void* buffer, size_t offset, size_t size);
413 bool read(void* buffer, size_t offset, size_t size);
vandebo@chromium.orga5180862010-10-26 19:48:49 +0000414 size_t getOffset() const { return fBytesWritten; }
reed@google.com8a85d0c2011-06-24 19:12:12 +0000415 size_t bytesWritten() const { return fBytesWritten; }
reed@android.com8a1c16f2008-12-17 15:59:43 +0000416
417 // copy what has been written to the stream into dst
reed@google.com8a85d0c2011-06-24 19:12:12 +0000418 void copyTo(void* dst) const;
reed@google.com70442a62011-06-23 21:48:04 +0000419
420 /**
reed@google.com8a85d0c2011-06-24 19:12:12 +0000421 * Return a copy of the data written so far. This call is responsible for
422 * calling unref() when they are finished with the data.
reed@google.com70442a62011-06-23 21:48:04 +0000423 */
reed@google.com8d0b5772011-06-24 13:07:31 +0000424 SkData* copyToData() const;
reed@google.com70442a62011-06-23 21:48:04 +0000425
reed@android.com8a1c16f2008-12-17 15:59:43 +0000426 // reset the stream to its original state
427 void reset();
428 void padToAlign4();
429private:
430 struct Block;
431 Block* fHead;
432 Block* fTail;
433 size_t fBytesWritten;
reed@google.com8a85d0c2011-06-24 19:12:12 +0000434 mutable SkData* fCopy; // is invalidated if we write after it is created
435
436 void invalidateCopy();
reed@google.com3b429982012-06-26 15:30:08 +0000437
438 typedef SkWStream INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000439};
440
441
reed@google.coma718c5e2013-03-05 17:49:10 +0000442class SK_API SkDebugWStream : public SkWStream {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000443public:
reed@google.com3b429982012-06-26 15:30:08 +0000444 SK_DECLARE_INST_COUNT(SkDebugWStream)
445
reed@android.com8a1c16f2008-12-17 15:59:43 +0000446 // overrides
tomhudson@google.com13413042011-10-03 16:01:10 +0000447 virtual bool write(const void* buffer, size_t size) SK_OVERRIDE;
448 virtual void newline() SK_OVERRIDE;
reed@google.com3b429982012-06-26 15:30:08 +0000449
450private:
451 typedef SkWStream INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000452};
453
454// for now
455typedef SkFILEStream SkURLStream;
456
457#endif