base: add 'String::print' method

This way, we can conveniently output strings without calling the
string() method.
This commit is contained in:
Norman Feske 2016-07-13 15:15:03 +02:00
parent 2127c8acf2
commit 38a1e95979
2 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,6 @@
#ifndef _INCLUDE__BASE__OUTPUT_H_
#define _INCLUDE__BASE__OUTPUT_H_
#include <util/string.h>
#include <base/stdint.h>
namespace Genode { struct Output; }

View File

@ -16,6 +16,7 @@
#define _INCLUDE__UTIL__STRING_H_
#include <base/stdint.h>
#include <base/output.h>
#include <util/misc_math.h>
#include <cpu/string.h>
@ -557,6 +558,8 @@ class Genode::String
{
return strcmp(string(), other.string()) != 0;
}
void print(Output &out) const { Genode::print(out, string()); }
};
#endif /* _INCLUDE__UTIL__STRING_H_ */