blob: 57c1d7c124971fd9fef4f8dc90b86ac7cc45a742 (
plain)
ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 02 00 00 00 90 91 68 | .PNG........IHDR...............h |
0020 | 36 00 00 03 00 50 4c 54 45 00 00 00 ff 00 00 00 ff 00 ff ff 00 00 00 ff ff 00 ff 00 ff ff ff ff | 6....PLTE....................... |
0040 | ff db db db b6 b6 b6 92 92 92 6d 6d 6d 49 49 49 24 24 24 db 00 00 b6 00 00 92 00 00 6d 00 00 49 | ..........mmmIII$$$.........m..I |
0060 | 00 00 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 24 00 db db 00 b6 b6 00 92 92 00 | ..$............m..I..$.......... |
0080 | 6d 6d 00 49 49 00 24 24 00 00 00 db 00 00 b6 00 00 92 00 00 6d 00 00 49 00 00 2/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef LOGOUTPUTBUFFER_HEADER
#define LOGOUTPUTBUFFER_HEADER
#include "log.h"
#include <queue>
class LogOutputBuffer : public ILogOutput
{
public:
LogOutputBuffer(LogMessageLevel maxlev)
{
log_add_output(this, maxlev);
}
~LogOutputBuffer()
{
log_remove_output(this);
}
virtual void printLog(const std::string &line)
{
m_buf.push(line);
}
std::string get()
{
if(empty())
return "";
std::string s = m_buf.front();
m_buf.pop();
return s;
}
bool empty()
{
return m_buf.empty();
}
private:
std::queue<std::string> m_buf;
};
#endif
|