0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 05:29:00 +02:00

ircd: Rename globular classes to indicate case insensitivity.

This commit is contained in:
Jason Volk 2020-03-19 11:29:11 -07:00
parent 71d6bd66c1
commit abfb106125
4 changed files with 14 additions and 14 deletions

View file

@ -14,14 +14,14 @@
namespace ircd
{
// Globular ('*' and '?') expression utils.
struct globular_match;
struct globular_equals;
struct globular_imatch;
struct globular_iequals;
}
/// Globular equals. This allows either side of the comparison to include '*'
/// and '?' characters and equality of the string expressions will be
/// determined.
struct ircd::globular_equals
/// determined. Case insensitive.
struct ircd::globular_iequals
:boolean
{
using is_transparent = std::true_type;
@ -30,7 +30,7 @@ struct ircd::globular_equals
template<class A,
class B>
globular_equals(A&& a, B&& b)
globular_iequals(A&& a, B&& b)
:boolean{operator()(std::forward<A>(a), std::forward<B>(b))}
{}
};
@ -39,23 +39,23 @@ struct ircd::globular_equals
/// comparison is considered to be the expression with '*' and '?' characters.
/// The expression string is passed at construction. The comparison inputs are
/// treated as non-expression strings. This allows for greater optimization
/// than globular_equals.
struct ircd::globular_match
/// than globular_equals. Case insensitive.
struct ircd::globular_imatch
{
string_view expr;
template<class A>
bool operator()(A&& a) const noexcept
{
const globular_equals globular_equals
const globular_iequals globular_iequals
{
expr, std::forward<A>(a)
};
return bool(globular_equals);
return bool(globular_iequals);
}
globular_match(const string_view &expr = {})
globular_imatch(const string_view &expr = {})
:expr{expr}
{}
};

View file

@ -9,11 +9,11 @@
// full license for this software is available in the LICENSE file.
//
// globular_equals
// globular_iequals
//
bool
ircd::globular_equals::operator()(const string_view &a, const string_view &b)
ircd::globular_iequals::operator()(const string_view &a, const string_view &b)
const noexcept
{
size_t ap(0), bp(0);

View file

@ -175,7 +175,7 @@ const
return !for_each(prop, [&server]
(const string_view &expression)
{
const globular_match match
const globular_imatch match
{
expression
};

View file

@ -408,7 +408,7 @@ command__read(const mutable_buffer &buf,
// The string argument can be a globular expression of room tags, like
// `m.*` or just `*`.
const globular_match match
const globular_imatch match
{
arg
};