mirror of
https://github.com/libretro/RetroArch
synced 2025-03-12 04:14:23 +00:00
(glslang) Slim down TInfoSinkBase
This commit is contained in:
parent
e4b933cb88
commit
0db7062c87
15
deps/glslang/glslang/glslang/Include/InfoSink.h
vendored
15
deps/glslang/glslang/glslang/Include/InfoSink.h
vendored
@ -53,12 +53,6 @@ enum TPrefixType {
|
||||
EPrefixNote
|
||||
};
|
||||
|
||||
enum TOutputStream {
|
||||
ENull = 0,
|
||||
EDebugger = 0x01,
|
||||
EStdOut = 0x02,
|
||||
EString = 0x04,
|
||||
};
|
||||
//
|
||||
// Encapsulate info logs for all objects that have them.
|
||||
//
|
||||
@ -67,8 +61,7 @@ enum TOutputStream {
|
||||
//
|
||||
class TInfoSinkBase {
|
||||
public:
|
||||
TInfoSinkBase() : outputStream(4) {}
|
||||
void erase() { sink.erase(); }
|
||||
TInfoSinkBase() {}
|
||||
TInfoSinkBase& operator<<(const TPersistString& t) { append(t); return *this; }
|
||||
TInfoSinkBase& operator<<(char c) { append(1, c); return *this; }
|
||||
TInfoSinkBase& operator<<(const char* s) { append(s); return *this; }
|
||||
@ -114,11 +107,6 @@ public:
|
||||
append("\n");
|
||||
}
|
||||
|
||||
void setOutputStream(int output = 4)
|
||||
{
|
||||
outputStream = output;
|
||||
}
|
||||
|
||||
protected:
|
||||
void append(const char* s);
|
||||
|
||||
@ -130,7 +118,6 @@ protected:
|
||||
sink.reserve(sink.capacity() + sink.capacity() / 2); }
|
||||
void appendToStream(const char* s);
|
||||
TPersistString sink;
|
||||
int outputStream;
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
@ -40,38 +40,30 @@ namespace glslang {
|
||||
|
||||
void TInfoSinkBase::append(const char* s)
|
||||
{
|
||||
if (outputStream & EString) {
|
||||
if (s == nullptr)
|
||||
sink.append("(null)");
|
||||
else {
|
||||
checkMem(strlen(s));
|
||||
sink.append(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TInfoSinkBase::append(int count, char c)
|
||||
{
|
||||
if (outputStream & EString) {
|
||||
checkMem(count);
|
||||
sink.append(count, c);
|
||||
}
|
||||
}
|
||||
|
||||
void TInfoSinkBase::append(const TPersistString& t)
|
||||
{
|
||||
if (outputStream & EString) {
|
||||
checkMem(t.size());
|
||||
sink.append(t);
|
||||
}
|
||||
}
|
||||
|
||||
void TInfoSinkBase::append(const TString& t)
|
||||
{
|
||||
if (outputStream & EString) {
|
||||
checkMem(t.size());
|
||||
sink.append(t.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
Loading…
x
Reference in New Issue
Block a user