AuROXTL/Include/auROXTL/auUTF8StringView.hpp

39 lines
1.3 KiB
C++

#pragma once
/* read-only, utf-8 *byte* view */
struct AuROString;
using AuUTF8StringView = AuROString;
using AuU8View = AuUTF8StringView;
// offset in bytes
using CodepointByteOffset_t = AuUInt;
// offset in codepoints
using CodepointOffset_t = AuUInt;
// AuStringUtils.hpp fwd decl
static constexpr CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition = {});
static auline constexpr bool AuEndsWith(AuROString const &value, AuROString const &ending);
static auline constexpr bool AuStartsWith(AuROString const &value, AuROString const &starting);
// TODO: implement AuStringView (does not exist yet) (without std::string_view)
#include "auMemoryUtils.hpp"
#include "Strings/auROString.hpp"
#include "Strings/auRONString.hpp"
inline constexpr bool operator==(const AuROString &lhs,
const AuROString &rhs) noexcept
{
return lhs.compare(rhs) == 0;
}
inline constexpr bool operator==(const AuRONString &lhs,
const AuRONString &rhs) noexcept
{
return AuROString(lhs) == AuROString(rhs);
}