2021-12-26 20:19:38 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2011-08-31 13:37:42 +00:00
|
|
|
*
|
2021-12-26 20:19:38 +00:00
|
|
|
* ScummVM is the legal property of its developers, whose names
|
2011-08-31 13:37:42 +00:00
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2021-12-26 20:19:38 +00:00
|
|
|
*
|
2012-12-19 22:15:43 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2011-08-31 13:37:42 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-12-19 22:15:43 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2021-12-26 20:19:38 +00:00
|
|
|
*
|
2012-12-19 22:15:43 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-31 13:37:42 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COMMON_STREAMDEBUG_H
|
|
|
|
#define COMMON_STREAMDEBUG_H
|
|
|
|
|
|
|
|
namespace Common {
|
|
|
|
|
|
|
|
class String;
|
|
|
|
class MessageStream;
|
|
|
|
|
2020-10-16 19:47:16 +00:00
|
|
|
class StreamDebug {
|
2011-08-31 13:37:42 +00:00
|
|
|
public:
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug(int level);
|
|
|
|
StreamDebug(const StreamDebug &other);
|
|
|
|
~StreamDebug();
|
2011-08-31 13:37:42 +00:00
|
|
|
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &space();
|
|
|
|
StreamDebug &nospace();
|
2011-08-31 13:37:42 +00:00
|
|
|
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &operator<<(const String &str);
|
|
|
|
StreamDebug &operator<<(const char *str);
|
|
|
|
StreamDebug &operator<<(char str);
|
|
|
|
StreamDebug &operator<<(int number);
|
|
|
|
StreamDebug &operator<<(unsigned int number);
|
2020-10-10 08:28:05 +00:00
|
|
|
|
2020-10-11 08:22:23 +00:00
|
|
|
// DC and DS has float and double equal
|
|
|
|
#if !defined(__DC__) && !defined(__DS__)
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &operator<<(double number);
|
2020-10-10 08:28:05 +00:00
|
|
|
#endif
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &operator<<(float number);
|
|
|
|
StreamDebug &operator<<(bool value);
|
|
|
|
StreamDebug &operator<<(void *p);
|
2011-08-31 13:37:42 +00:00
|
|
|
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &operator=(const StreamDebug &other);
|
2011-08-31 13:37:42 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-16 19:47:16 +00:00
|
|
|
StreamDebug &maybeSpace();
|
2011-08-31 13:37:42 +00:00
|
|
|
|
|
|
|
MessageStream *_stream;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-10-16 19:47:16 +00:00
|
|
|
Common::StreamDebug streamDbg(int level = -1);
|
2011-08-31 13:37:42 +00:00
|
|
|
|
|
|
|
#endif
|