util/string.h: String::operator ==

This commit is contained in:
Norman Feske 2014-01-12 00:00:53 +01:00 committed by Christian Helmuth
parent bdfbe9f20e
commit 332aeba844
1 changed files with 6 additions and 0 deletions

View File

@ -480,6 +480,12 @@ namespace Genode {
return (_length <= CAPACITY) && (_buf[_length - 1] == '\0'); }
char const *string() const { return valid() ? _buf : ""; }
template <size_t OTHER_CAPACITY>
bool operator == (String<OTHER_CAPACITY> const &other) const
{
return strcmp(string(), other.string()) == 0;
}
};
}