COMMON: New overloads for char and void* for the stream debug interface.

This commit is contained in:
Giulio Camuffo 2011-09-14 22:50:18 +02:00
parent b89fb79216
commit 25b3704c68
2 changed files with 12 additions and 0 deletions

View file

@ -87,6 +87,11 @@ Debug &Debug::operator<<(const char *str) {
return maybeSpace(); return maybeSpace();
} }
Debug &Debug::operator<<(char str) {
_stream->msg += str;
return maybeSpace();
}
Debug &Debug::operator<<(int num) { Debug &Debug::operator<<(int num) {
_stream->msg += String::format("%d", num); _stream->msg += String::format("%d", num);
return maybeSpace(); return maybeSpace();
@ -102,6 +107,11 @@ Debug &Debug::operator<<(bool value) {
return maybeSpace(); return maybeSpace();
} }
Debug &Debug::operator<<(void *p) {
_stream->msg += String::format("%p", p);
return maybeSpace();
}
Debug &Debug::operator=(const Debug &other) { Debug &Debug::operator=(const Debug &other) {
_stream = other._stream; _stream = other._stream;
++_stream->ref; ++_stream->ref;

View file

@ -41,9 +41,11 @@ public:
Debug &operator<<(const String &str); Debug &operator<<(const String &str);
Debug &operator<<(const char *str); Debug &operator<<(const char *str);
Debug &operator<<(char str);
Debug &operator<<(int number); Debug &operator<<(int number);
Debug &operator<<(float number); Debug &operator<<(float number);
Debug &operator<<(bool value); Debug &operator<<(bool value);
Debug &operator<<(void *p);
Debug &operator=(const Debug &other); Debug &operator=(const Debug &other);