OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkStream_DEFINED | 8 #ifndef SkStream_DEFINED |
9 #define SkStream_DEFINED | 9 #define SkStream_DEFINED |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool writeText(const char text[]); | 198 bool writeText(const char text[]); |
199 bool writeDecAsText(int32_t); | 199 bool writeDecAsText(int32_t); |
200 bool writeBigDecAsText(int64_t, int minDigits = 0); | 200 bool writeBigDecAsText(int64_t, int minDigits = 0); |
201 bool writeHexAsText(uint32_t, int minDigits = 0); | 201 bool writeHexAsText(uint32_t, int minDigits = 0); |
202 bool writeScalarAsText(SkScalar); | 202 bool writeScalarAsText(SkScalar); |
203 | 203 |
204 bool writeBool(bool v) { return this->write8(v); } | 204 bool writeBool(bool v) { return this->write8(v); } |
205 bool writeScalar(SkScalar); | 205 bool writeScalar(SkScalar); |
206 bool writePackedUInt(size_t); | 206 bool writePackedUInt(size_t); |
207 | 207 |
208 bool writeStream(SkStream* input, size_t length); | 208 bool writeStream(SkStream* input, size_t length); |
209 | 209 |
210 /** | 210 /** |
211 * Append an SkData object to the stream, such that it can be read | 211 * Append an SkData object to the stream, such that it can be read |
212 * out of the stream using SkStream::readData(). | 212 * out of the stream using SkStream::readData(). |
213 * | 213 * |
214 * Note that the encoding method used to write the SkData object | 214 * Note that the encoding method used to write the SkData object |
215 * to the stream may change over time. This method DOES NOT | 215 * to the stream may change over time. This method DOES NOT |
216 * just write the raw content of the SkData object to the stream. | 216 * just write the raw content of the SkData object to the stream. |
217 */ | 217 */ |
218 bool writeData(const SkData*); | 218 bool writeData(const SkData*); |
| 219 |
| 220 /** |
| 221 * This returns the number of bytes in the stream required to store |
| 222 * 'value'. |
| 223 */ |
| 224 static int SizeOfPackedUInt(size_t value); |
219 }; | 225 }; |
220 | 226 |
221 ////////////////////////////////////////////////////////////////////////////////
//////// | 227 ////////////////////////////////////////////////////////////////////////////////
//////// |
222 | 228 |
223 #include "SkString.h" | 229 #include "SkString.h" |
224 #include <stdio.h> | 230 #include <stdio.h> |
225 | 231 |
226 struct SkFILE; | 232 struct SkFILE; |
227 | 233 |
228 /** A stream that wraps a C FILE* file stream. */ | 234 /** A stream that wraps a C FILE* file stream. */ |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 virtual void newline() SK_OVERRIDE; | 451 virtual void newline() SK_OVERRIDE; |
446 | 452 |
447 private: | 453 private: |
448 typedef SkWStream INHERITED; | 454 typedef SkWStream INHERITED; |
449 }; | 455 }; |
450 | 456 |
451 // for now | 457 // for now |
452 typedef SkFILEStream SkURLStream; | 458 typedef SkFILEStream SkURLStream; |
453 | 459 |
454 #endif | 460 #endif |
OLD | NEW |