thread_local char sExceptionFlingerMessageBuffer[ExceptionFlinger::MESSAGE_BUFFER_SIZE]{};
}
-char* ExceptionFlinger::GetMessageBuffer()
+StreamBuffer::StreamBuffer(char* buffer, size_t size) noexcept(true)
+{
+ setp(buffer, buffer + size);
+}
+
+ExceptionFlinger::Impl::~Impl() noexcept(false)
+{
+ throw DaliException(mLocation, GetMessageBuffer());
+}
+
+ExceptionFlinger::ExceptionFlinger(const char* location) noexcept(true)
+: mImpl{ location },
+ mStreamBuffer(GetMessageBuffer(), MESSAGE_BUFFER_SIZE - 1),
+ mStream(&mStreamBuffer)
+{}
+
+ExceptionFlinger::~ExceptionFlinger() noexcept(false)
+{
+ operator<<('\0');
+}
+
+char* ExceptionFlinger::GetMessageBuffer() noexcept(true)
{
return sExceptionFlingerMessageBuffer;
}