blob: 6690d883e35344dec17c22859a47da08ec9c1596 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
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.combbf56f72010-04-20 18:52:13 +00007#include "compiler/InfoSink.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00008
9#ifdef _WIN32
10 #include <windows.h>
11#endif
12
13void TInfoSinkBase::append(const char *s)
14{
15 if (outputStream & EString) {
16 checkMem(strlen(s));
17 sink.append(s);
18 }
19
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000020 if (outputStream & EStdOut)
21 fprintf(stdout, "%s", s);
22}
23
24void TInfoSinkBase::append(int count, char c)
25{
26 if (outputStream & EString) {
27 checkMem(count);
28 sink.append(count, c);
29 }
30
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000031 if (outputStream & EStdOut)
32 fprintf(stdout, "%c", c);
33}
34
35void TInfoSinkBase::append(const TPersistString& t)
36{
37 if (outputStream & EString) {
38 checkMem(t.size());
39 sink.append(t);
40 }
41
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000042 if (outputStream & EStdOut)
43 fprintf(stdout, "%s", t.c_str());
44}
45
46void TInfoSinkBase::append(const TString& t)
47{
48 if (outputStream & EString) {
49 checkMem(t.size());
50 sink.append(t.c_str());
51 }
52
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000053 if (outputStream & EStdOut)
54 fprintf(stdout, "%s", t.c_str());
55}