base: add util/dictionary.h utility

The new 'Dictionary' provides an easy way to access objects using
strings as key. The 'String' received the 'operator >' to simplify the
organization of strings in an AVL tree.

The patch removes the former definition of the 'operator >' from the
platform driver because it would be ambigious now.

Fixes #4610
This commit is contained in:
Norman Feske
2022-09-14 15:35:13 +02:00
parent 6df66a77d0
commit 3be0136901
4 changed files with 154 additions and 12 deletions

View File

@ -808,6 +808,12 @@ class Genode::String
return strcmp(string(), other.string()) != 0;
}
template <size_t N>
bool operator > (String<N> const &other) const
{
return strcmp(string(), other.string()) > 0;
}
void print(Output &out) const { Genode::print(out, string()); }
};