mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
util/string.h: String::operator ==
This commit is contained in:
parent
bdfbe9f20e
commit
332aeba844
@ -480,6 +480,12 @@ namespace Genode {
|
|||||||
return (_length <= CAPACITY) && (_buf[_length - 1] == '\0'); }
|
return (_length <= CAPACITY) && (_buf[_length - 1] == '\0'); }
|
||||||
|
|
||||||
char const *string() const { return valid() ? _buf : ""; }
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user