Compare commits

..

2 Commits

Author SHA1 Message Date
f7722a1b1c [+] AU_BIT_FIELD_INIT_AFTER_20 2024-09-27 18:18:11 +01:00
c2d29861e3 [+] AuEndsWith char variant
[+] AuStartsWith char variant
2024-09-27 18:17:53 +01:00
2 changed files with 26 additions and 0 deletions

View File

@ -253,8 +253,10 @@
#if defined(AU_LANG_CPP_20_)
#define AU_BIT_FIELD_AFTER_20(n) : n
#define AU_BIT_FIELD_INIT_AFTER_20(n) { n }
#else
#define AU_BIT_FIELD_AFTER_20(n)
#define AU_BIT_FIELD_INIT_AFTER_20(n)
#endif
#if defined(AU_LANG_CPP_20_)

View File

@ -52,6 +52,18 @@ static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, AuROStrin
}
}
static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, const char &ending)
{
if (value.empty())
{
return false;
}
else
{
return value[value.size() - 1] == ending;
}
}
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROString const &starting)
{
#if defined(AU_STRING_IS_TINYUTF_EXPERIMENT)
@ -63,6 +75,18 @@ static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROStr
#endif
}
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, const char &starting)
{
if (value.empty())
{
return false;
}
else
{
return value[0] == starting;
}
}
/// Alias for AuCodepointsToLower
static AuString AuToLower(const AuROString &in)
{