mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 09:36:54 +01:00
ircd:Ⓜ️🆔 Minor reorg.
This commit is contained in:
parent
d60a7622e1
commit
4eed3e5ca0
1 changed files with 19 additions and 19 deletions
|
@ -83,6 +83,25 @@ struct ircd::m::id
|
|||
id() = default;
|
||||
};
|
||||
|
||||
// Utilities
|
||||
namespace ircd::m
|
||||
{
|
||||
// Check if any sigil
|
||||
bool is_sigil(const char &c) noexcept;
|
||||
bool has_sigil(const string_view &) noexcept;
|
||||
|
||||
// Interpret sigil type (or throw)
|
||||
id::sigil sigil(const char &c);
|
||||
id::sigil sigil(const string_view &id);
|
||||
string_view reflect(const id::sigil &);
|
||||
|
||||
// Full ID checks
|
||||
bool valid(const id::sigil &, const string_view &) noexcept;
|
||||
bool valid_local(const id::sigil &, const string_view &) noexcept; // Local part is valid
|
||||
bool valid_local_only(const id::sigil &, const string_view &) noexcept; // No :host
|
||||
void validate(const id::sigil &, const string_view &); // valid() | throws
|
||||
}
|
||||
|
||||
/// (4.2) The sigil characters
|
||||
enum ircd::m::id::sigil
|
||||
:char
|
||||
|
@ -244,25 +263,6 @@ struct ircd::m::id::node
|
|||
node() = default;
|
||||
};
|
||||
|
||||
// Utilities
|
||||
namespace ircd::m
|
||||
{
|
||||
// Check if any sigil
|
||||
bool is_sigil(const char &c) noexcept;
|
||||
bool has_sigil(const string_view &) noexcept;
|
||||
|
||||
// Interpret sigil type (or throw)
|
||||
id::sigil sigil(const char &c);
|
||||
id::sigil sigil(const string_view &id);
|
||||
string_view reflect(const id::sigil &);
|
||||
|
||||
// Full ID checks
|
||||
bool valid(const id::sigil &, const string_view &) noexcept;
|
||||
bool valid_local(const id::sigil &, const string_view &) noexcept; // Local part is valid
|
||||
bool valid_local_only(const id::sigil &, const string_view &) noexcept; // No :host
|
||||
void validate(const id::sigil &, const string_view &); // valid() | throws
|
||||
}
|
||||
|
||||
/// ID object backed by an internal buffer of default worst-case size.
|
||||
///
|
||||
template<class T>
|
||||
|
|
Loading…
Reference in a new issue