base: char const * comparison operators for String

This commit is contained in:
Norman Feske 2015-10-05 15:42:24 +02:00 committed by Christian Helmuth
parent a528aa097a
commit 96d021b9d4
1 changed files with 10 additions and 0 deletions

View File

@ -524,6 +524,16 @@ class Genode::String
char const *string() const { return valid() ? _buf : ""; }
bool operator == (char const *other) const
{
return strcmp(string(), other) == 0;
}
bool operator != (char const *other) const
{
return strcmp(string(), other) != 0;
}
template <size_t OTHER_CAPACITY>
bool operator == (String<OTHER_CAPACITY> const &other) const
{