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 | 8 |
9 #include "SkStream.h" | 9 #include "SkStream.h" |
10 #include "SkStreamPriv.h" | 10 #include "SkStreamPriv.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 void SkWStream::newline() | 72 void SkWStream::newline() |
73 { | 73 { |
74 this->write("\n", 1); | 74 this->write("\n", 1); |
75 } | 75 } |
76 | 76 |
77 void SkWStream::flush() | 77 void SkWStream::flush() |
78 { | 78 { |
79 } | 79 } |
80 | 80 |
81 bool SkWStream::writeText(const char text[]) | |
82 { | |
83 SkASSERT(text); | |
84 return this->write(text, strlen(text)); | |
85 } | |
86 | |
87 bool SkWStream::writeDecAsText(int32_t dec) | 81 bool SkWStream::writeDecAsText(int32_t dec) |
88 { | 82 { |
89 char buffer[SkStrAppendS32_MaxSize]; | 83 char buffer[SkStrAppendS32_MaxSize]; |
90 char* stop = SkStrAppendS32(buffer, dec); | 84 char* stop = SkStrAppendS32(buffer, dec); |
91 return this->write(buffer, stop - buffer); | 85 return this->write(buffer, stop - buffer); |
92 } | 86 } |
93 | 87 |
94 bool SkWStream::writeBigDecAsText(int64_t dec, int minDigits) | 88 bool SkWStream::writeBigDecAsText(int64_t dec, int minDigits) |
95 { | 89 { |
96 char buffer[SkStrAppendU64_MaxSize]; | 90 char buffer[SkStrAppendU64_MaxSize]; |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 while (true) { | 899 while (true) { |
906 count = input->read(scratch, sizeof(scratch)); | 900 count = input->read(scratch, sizeof(scratch)); |
907 if (0 == count) { | 901 if (0 == count) { |
908 return true; | 902 return true; |
909 } | 903 } |
910 if (!out->write(scratch, count)) { | 904 if (!out->write(scratch, count)) { |
911 return false; | 905 return false; |
912 } | 906 } |
913 } | 907 } |
914 } | 908 } |
OLD | NEW |