daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame^] | 7 | #include "compiler/InfoSink.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 8 | |
| 9 | #ifdef _WIN32 |
| 10 | #include <windows.h> |
| 11 | #endif |
| 12 | |
| 13 | void TInfoSinkBase::append(const char *s) |
| 14 | { |
| 15 | if (outputStream & EString) { |
| 16 | checkMem(strlen(s)); |
| 17 | sink.append(s); |
| 18 | } |
| 19 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 20 | if (outputStream & EStdOut) |
| 21 | fprintf(stdout, "%s", s); |
| 22 | } |
| 23 | |
| 24 | void TInfoSinkBase::append(int count, char c) |
| 25 | { |
| 26 | if (outputStream & EString) { |
| 27 | checkMem(count); |
| 28 | sink.append(count, c); |
| 29 | } |
| 30 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 31 | if (outputStream & EStdOut) |
| 32 | fprintf(stdout, "%c", c); |
| 33 | } |
| 34 | |
| 35 | void TInfoSinkBase::append(const TPersistString& t) |
| 36 | { |
| 37 | if (outputStream & EString) { |
| 38 | checkMem(t.size()); |
| 39 | sink.append(t); |
| 40 | } |
| 41 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 42 | if (outputStream & EStdOut) |
| 43 | fprintf(stdout, "%s", t.c_str()); |
| 44 | } |
| 45 | |
| 46 | void TInfoSinkBase::append(const TString& t) |
| 47 | { |
| 48 | if (outputStream & EString) { |
| 49 | checkMem(t.size()); |
| 50 | sink.append(t.c_str()); |
| 51 | } |
| 52 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 53 | if (outputStream & EStdOut) |
| 54 | fprintf(stdout, "%s", t.c_str()); |
| 55 | } |