SlHelpers
Toggle main menu visibility
Loading...
Searching...
No Matches
SUSE.h
1
// SPDX-License-Identifier: GPL-2.0-only
2
3
#pragma once
4
5
#include <string_view>
6
7
#include "String.h"
8
9
namespace
SlHelpers {
10
14
struct
SUSE
{
15
17
static
constexpr
std::string_view
suseDomains
[] = {
18
"@suse.com"
,
19
"@suse.cz"
,
20
"@suse.de"
,
21
};
22
28
static
constexpr
bool
isSUSEAddress
(std::string_view email) {
29
for
(
const
auto
&suseEmail :
suseDomains
)
30
if
(
String::iEndsWith
(email, suseEmail))
31
return
true
;
32
return
false
;
33
}
34
};
35
36
}
SlHelpers::String::iEndsWith
static constexpr bool iEndsWith(std::string_view str, std::string_view suffix) noexcept
Like string::ends_with() but ignoring case.
Definition
String.h:118
SlHelpers::SUSE
Helpers specific to SUSE.
Definition
SUSE.h:14
SlHelpers::SUSE::isSUSEAddress
static constexpr bool isSUSEAddress(std::string_view email)
Evaluate if email is likely a SUSE address.
Definition
SUSE.h:28
SlHelpers::SUSE::suseDomains
static constexpr std::string_view suseDomains[]
List of SUSE e-mail domains.
Definition
SUSE.h:17
include
helpers
SUSE.h
Generated by
1.17.0