ludus::foundation¶
Ludus Wiki · API overview · Browse API
Namespace
Declared in cmake/build_metadata.hpp.in
Related declarations¶
- ludus::foundation::AllocationCoverageExclusion
- ludus::foundation::AllocationDomain
- ludus::foundation::AllocationStatistics
- ludus::foundation::BorrowedView
- ludus::foundation::DomainDeleter
- ludus::foundation::Fingerprint128
- ludus::foundation::FrozenStringTable
- ludus::foundation::IsTriviallyRelocatableTrait
- ludus::foundation::KeyLess
- ludus::foundation::NameId
- ludus::foundation::NameLiteral
- ludus::foundation::RegisteredAllocationDomain
- ludus::foundation::SharedPtr
- ludus::foundation::SharedString
- ludus::foundation::SipHashKey
- ludus::foundation::StaticString
- ludus::foundation::String
- ludus::foundation::StringBuilder
- ludus::foundation::StringIndex
- ludus::foundation::StringTable
- ludus::foundation::StringTableConfig
- ludus::foundation::TargetInfo
- ludus::foundation::Utf8View
- ludus::foundation::Version
- ludus::foundation::WeakPtr
- ludus::foundation::base
- ludus::foundation::build_metadata
- ludus::foundation::config
- ludus::foundation::core
- ludus::foundation::diagnostics
- ludus::foundation::filesystem
- ludus::foundation::geometry
- ludus::foundation::identity
- ludus::foundation::logging
- ludus::foundation::math
- ludus::foundation::parsing
- ludus::foundation::profiling
- ludus::foundation::reflection
- ludus::foundation::serialization
- ludus::foundation::threading
- ludus::foundation::time
- ludus::foundation::unicode
Enumerations¶
NumberParseStatus¶
enum class NumberParseStatus : uint8
Related types: uint8
Success¶
Success
InvalidSyntax¶
InvalidSyntax
OutOfRange¶
OutOfRange
TooLong¶
TooLong
Declared in modules/foundation/base/include/ludus/foundation/base/parse_number.hpp
TargetOs¶
enum class TargetOs : uint8
Related types: uint8
Web¶
Web = LUDUS_OS_WEB
Windows¶
Windows = LUDUS_OS_WINDOWS
MacOS¶
MacOS = LUDUS_OS_MACOS
Linux¶
Linux = LUDUS_OS_LINUX
Android¶
Android = LUDUS_OS_ANDROID
IOS¶
IOS = LUDUS_OS_IOS
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
TargetArch¶
enum class TargetArch : uint8
Related types: uint8
Wasm32¶
Wasm32 = LUDUS_CPU_WASM32
Wasm64¶
Wasm64 = LUDUS_CPU_WASM64
X86_64¶
X86_64 = LUDUS_CPU_X86_64
Arm64¶
Arm64 = LUDUS_CPU_ARM64
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
TargetCompiler¶
enum class TargetCompiler : uint8
Related types: uint8
Clang¶
Clang = LUDUS_CXX_CLANG
Gcc¶
Gcc = LUDUS_CXX_GCC
Msvc¶
Msvc = LUDUS_CXX_MSVC
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
TargetEndian¶
enum class TargetEndian : uint8
Related types: uint8
Little¶
Little = LUDUS_ENDIAN_LITTLE
Big¶
Big = LUDUS_ENDIAN_BIG
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
AccountingValidity¶
enum class AccountingValidity : uint8
Related types: uint8
Valid¶
Valid
Saturated¶
Saturated
AccountingError¶
AccountingError
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
AllocationDomainRegistrationStatus¶
enum class AllocationDomainRegistrationStatus : uint8
TryRegisterAllocationDomain. Related types: uint8
Ok¶
Ok
InvalidName¶
InvalidName
NameCollision¶
NameCollision
DomainAlreadyRegistered¶
DomainAlreadyRegistered
RegistryFull¶
RegistryFull
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
OwnershipStatus¶
enum class OwnershipStatus : uint8
Ok means the output owner was left unchanged and no ownership was acquired. Related types: uint8
Ok¶
Ok
InvalidState¶
InvalidState
TooLarge¶
TooLarge
OutOfMemory¶
OutOfMemory
Declared in modules/foundation/memory/include/ludus/foundation/memory/owned_object.hpp
StringStatus¶
enum class StringStatus : uint8
Related types: uint8
Ok¶
Ok
OutOfMemory¶
OutOfMemory
TooLarge¶
TooLarge
CapacityExceeded¶
CapacityExceeded
InvalidArgument¶
InvalidArgument
InvalidUtf8¶
InvalidUtf8
EmbeddedZero¶
EmbeddedZero
InvalidHandle¶
InvalidHandle
WrongTable¶
WrongTable
NotFound¶
NotFound
TokenExhausted¶
TokenExhausted
ProbeExhausted¶
ProbeExhausted
Declared in modules/foundation/strings/include/ludus/foundation/strings/status.hpp
StringHashPolicy¶
enum class StringHashPolicy : uint8
Related types: uint8
Trusted¶
Trusted
StringTableConfig::Key is ignored. Untrusted¶
Untrusted
StringTableConfig::Key (KeyedTableHash64) for hostile input. Requires StringTableConfig::HasSecretKey; it resists hash flooding but does not bound admitted volume. Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp
Aliases¶
UniquePtr¶
template <typename ElementType, typename DeleterType = core::DefaultDeleter<ElementType>>
using ludus::foundation::UniquePtr = core::UniquePtr<ElementType, DeleterType>
core::UniquePtr, including its deleter parameter. Related types: core::UniquePtr
Declared in modules/foundation/base/include/ludus/foundation/base/pointer.hpp
Array¶
template <typename ElementType>
using ludus::foundation::Array = core::Array<ElementType>
Related types: core::Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
FixedArray¶
template <typename ElementType, core::usize Count>
using ludus::foundation::FixedArray = core::FixedArray<ElementType, Count>
Related types: core::FixedArray
Declared in modules/foundation/containers/include/ludus/foundation/containers/fixed_array.hpp
RingBuffer¶
template <typename ElementType, core::usize Count>
using ludus::foundation::RingBuffer = core::RingBuffer<ElementType, Count>
Related types: core::RingBuffer
Declared in modules/foundation/containers/include/ludus/foundation/containers/ring_buffer.hpp
SortedMap¶
template <typename KeyType, typename ValueType, typename Compare = KeyLess>
using ludus::foundation::SortedMap = core::SortedMap<KeyType, ValueType, Compare>
Related types: core::SortedMap
Declared in modules/foundation/containers/include/ludus/foundation/containers/sorted_map.hpp
StaticArray¶
template <typename ElementType, core::usize Count>
using ludus::foundation::StaticArray = core::StaticArray<ElementType, Count>
Related types: core::StaticArray
Declared in modules/foundation/containers/include/ludus/foundation/containers/static_array.hpp
StaticBitSet¶
template <core::usize BitCount>
using ludus::foundation::StaticBitSet = core::StaticBitSet<BitCount>
Related types: core::StaticBitSet
Declared in modules/foundation/containers/include/ludus/foundation/containers/static_bit_set.hpp
AllocationDomainId¶
using ludus::foundation::AllocationDomainId = uint32
Related types: uint32
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
nullptr_t¶
using ludus::foundation::core::nullptr_t = decltype(nullptr)
Declared in modules/foundation/base/include/ludus/foundation/base/core.h
float32¶
using ludus::foundation::core::float32 = float
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
float64¶
using ludus::foundation::core::float64 = double
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
int16¶
using ludus::foundation::core::int16 = std::int16_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
int32¶
using ludus::foundation::core::int32 = std::int32_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
int64¶
using ludus::foundation::core::int64 = std::int64_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
int8¶
using ludus::foundation::core::int8 = std::int8_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
isize¶
using ludus::foundation::core::isize = std::ptrdiff_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
uint16¶
using ludus::foundation::core::uint16 = std::uint16_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
uint32¶
using ludus::foundation::core::uint32 = std::uint32_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
uint64¶
using ludus::foundation::core::uint64 = std::uint64_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
uint8¶
using ludus::foundation::core::uint8 = std::uint8_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
usize¶
using ludus::foundation::core::usize = std::size_t
Declared in modules/foundation/base/include/ludus/foundation/base/types.h
Constants and variables¶
kTarget¶
constexpr TargetInfo ludus::foundation::kTarget {
.Os = static_cast<TargetOs>(LUDUS_TARGET_OS),
.Arch = static_cast<TargetArch>(LUDUS_TARGET_ARCH),
.Compiler = static_cast<TargetCompiler>(LUDUS_TARGET_COMPILER),
.Endian = static_cast<TargetEndian>(LUDUS_TARGET_ENDIAN),
.PointerBits = LUDUS_POINTER_BITS,
}
Related types: TargetInfo
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
SYSTEM_ALLOCATION_DOMAIN_ID¶
constexpr AllocationDomainId ludus::foundation::SYSTEM_ALLOCATION_DOMAIN_ID = 1
System domain returned by GetSystemAllocationDomain. Related types: AllocationDomainId
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
CONTAINERS_ALLOCATION_DOMAIN_ID¶
constexpr AllocationDomainId ludus::foundation::CONTAINERS_ALLOCATION_DOMAIN_ID = 2
Containers domain returned by GetContainerAllocationDomain. Related types: AllocationDomainId
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
MAX_ALLOCATION_DOMAINS¶
constexpr usize ludus::foundation::MAX_ALLOCATION_DOMAINS = 32
Related types: usize
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
MAX_ALLOCATION_DOMAIN_NAME_BYTES¶
constexpr usize ludus::foundation::MAX_ALLOCATION_DOMAIN_NAME_BYTES = 47
Related types: usize
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
IsTriviallyRelocatable¶
template <typename ElementType>
constexpr bool ludus::foundation::core::IsTriviallyRelocatable
Declared in modules/foundation/containers/include/ludus/foundation/containers/relocation.hpp
Functions¶
ParseFloat32¶
NumberParseStatus ludus::foundation::ParseFloat32(const char *text, usize size, float32 &output) noexcept
| Parameter | Description |
|---|---|
text |
Input bytes; may be null only when size is zero. No whitespace, leading plus, leading zeroes, hexadecimal, NaN or infinity is accepted.
|
size |
Number of bytes, at most 1024; the complete input must match.
|
output |
Updated only on success. Negative zero and subnormals are preserved.
|
Returns
Note
Related types: NumberParseStatus · float32 · usize
Declared in modules/foundation/base/include/ludus/foundation/base/parse_number.hpp
ParseUint64¶
NumberParseStatus ludus::foundation::ParseUint64(const char *text, usize size, uint64 &output) noexcept
| Parameter | Description |
|---|---|
text |
Input bytes; may be null only when size is zero. Digits only; leading zeroes are accepted, signs and whitespace are rejected.
|
size |
Number of bytes, at most 1024.
|
output |
Updated only on success.
|
Returns
Related types: NumberParseStatus · uint64 · usize
Declared in modules/foundation/base/include/ludus/foundation/base/parse_number.hpp
TargetOsName¶
constexpr const char * ludus::foundation::TargetOsName(TargetOs value) noexcept
Related types: TargetOs
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
TargetArchName¶
constexpr const char * ludus::foundation::TargetArchName(TargetArch value) noexcept
Related types: TargetArch
Declared in modules/foundation/base/include/ludus/foundation/base/target.hpp
version¶
Version ludus::foundation::version() noexcept
Related types: Version
Declared in modules/foundation/base/include/ludus/foundation/base/version.hpp
version_string¶
std::string_view ludus::foundation::version_string() noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/version.hpp
git_revision¶
std::string_view ludus::foundation::git_revision() noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/version.hpp
compiler_identity¶
std::string_view ludus::foundation::compiler_identity() noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/version.hpp
Sort¶
template <typename T, typename Compare>
void ludus::foundation::Sort(T *values, usize count, const Compare &less) noexcept
| Parameter | Description |
|---|---|
values |
Array of at least count initialized elements; may be null when count is zero.
|
count |
Number of elements to sort.
|
less |
Nonthrowing strict weak ordering over elements.
|
Precondition
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/sort.hpp
StableSort¶
template <typename T, typename Compare>
bool ludus::foundation::StableSort(T *values, T *scratch, usize count, const Compare &less) noexcept
| Parameter | Description |
|---|---|
values |
Mutable array of count initialized elements.
|
scratch |
Separate array of at least count initialized elements; contents may be overwritten.
|
count |
Element count; zero permits null arrays.
|
less |
Nonthrowing strict weak order; equivalent values retain their input order.
|
Returns
Precondition
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/stable_sort.hpp
SymbolFingerprint64¶
constexpr uint64 ludus::foundation::SymbolFingerprint64(std::string_view bytes) noexcept
Related types: uint64
Declared in modules/foundation/hash/include/ludus/foundation/hash/hash.hpp
TableHash64¶
uint64 ludus::foundation::TableHash64(std::span< const uint8 > bytes) noexcept
Declared in modules/foundation/hash/include/ludus/foundation/hash/hash.hpp
StableFingerprint128¶
Fingerprint128 ludus::foundation::StableFingerprint128(std::span< const uint8 > bytes) noexcept
Related types: uint8 · Fingerprint128
Declared in modules/foundation/hash/include/ludus/foundation/hash/hash.hpp
KeyedTableHash64¶
uint64 ludus::foundation::KeyedTableHash64(std::span< const uint8 > bytes, SipHashKey key) noexcept
Related types: uint64 · uint8 · SipHashKey
Declared in modules/foundation/hash/include/ludus/foundation/hash/hash.hpp
GetSystemAllocationDomain¶
const AllocationDomain & ludus::foundation::GetSystemAllocationDomain() noexcept
System (SYSTEM_ALLOCATION_DOMAIN_ID); the general domain for engine-owned storage without a more specific domain. Returns
Related types: AllocationDomain
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_domain.hpp
GetContainerAllocationDomain¶
const AllocationDomain & ludus::foundation::GetContainerAllocationDomain() noexcept
Array storage. Containers (CONTAINERS_ALLOCATION_DOMAIN_ID). It uses the same system backend as GetSystemAllocationDomain, so its blocks are interchangeable at the backend level, but it is a separate accounting origin: free its blocks only through this domain. Returns
Related types: AllocationDomain
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_domain.hpp
GetAllocationStatistics¶
AllocationStatistics ludus::foundation::GetAllocationStatistics(const AllocationDomain &domain) noexcept
| Parameter | Description |
|---|---|
domain |
Any domain, registered or not.
|
Returns
domain, fields may come from different moments; at a quiescent boundary LiveRequestedBytes == AllocatedBytes - FreedBytes and LiveBlocks == AllocationCount - FreeCount while Validity is Valid. Note
Related types: AllocationDomain · AllocationStatistics
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
TryRegisterAllocationDomain¶
AllocationDomainRegistrationStatus ludus::foundation::TryRegisterAllocationDomain(const AllocationDomain &domain, const char *name, AllocationDomainId &outId) noexcept
| Parameter | Description |
|---|---|
domain |
Domain with static storage duration. Registered domains are never removed, so a shorter-lived domain must not be registered.
|
name |
Null-terminated name of 1 to MAX_ALLOCATION_DOMAIN_NAME_BYTES ASCII letters, digits, '.', '_' or '-'.
|
outId |
Receives the domain's ID on
Ok; unchanged otherwise. |
Returns
Note
Related types: AllocationDomain · AllocationDomainRegistrationStatus · AllocationDomainId
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
GetRegisteredAllocationDomainCount¶
usize ludus::foundation::GetRegisteredAllocationDomainCount() noexcept
Returns
Note
Related types: usize
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
TryGetRegisteredAllocationDomain¶
bool ludus::foundation::TryGetRegisteredAllocationDomain(usize index, RegisteredAllocationDomain &outEntry) noexcept
| Parameter | Description |
|---|---|
index |
Entry index, below
GetRegisteredAllocationDomainCount(). |
outEntry |
Receives the entry on success; unchanged otherwise.
|
Returns
index is not published. Note
Related types: usize · RegisteredAllocationDomain
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
GetAllocationCoverageExclusionCount¶
usize ludus::foundation::GetAllocationCoverageExclusionCount() noexcept
Returns
Related types: usize
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
GetAllocationCoverageExclusion¶
const AllocationCoverageExclusion & ludus::foundation::GetAllocationCoverageExclusion(usize index) noexcept
| Parameter | Description |
|---|---|
index |
Entry index, below
GetAllocationCoverageExclusionCount(). |
Returns
Precondition
index < GetAllocationCoverageExclusionCount(); violations terminate through LUDUS_REQUIRE. Related types: usize · AllocationCoverageExclusion
Declared in modules/foundation/memory/include/ludus/foundation/memory/allocation_statistics.hpp
TryCreateOwned¶
template <typename ElementType, typename... ArgumentTypes>
OwnershipStatus ludus::foundation::TryCreateOwned(const AllocationDomain &domain, UniquePtr< ElementType, DomainDeleter< ElementType > > &inoutOwner, ArgumentTypes &&... arguments) noexcept
requires (std::is_object_v<ElementType> && std::is_array_v<ElementType> == false && std::is_same_v<ElementType, std::remove_cv_t<ElementType>> && std::is_nothrow_constructible_v<ElementType, ArgumentTypes&&...> && std::is_nothrow_destructible_v<ElementType>)
domain and writes its owner. usize arithmetic, request exactly sizeof(ElementType) bytes at alignof(ElementType) (including over-aligned types), and only then forward arguments to the constructor. Allocation failure therefore never consumes move arguments. The resulting owner frees through domain with that same layout.| Template parameter | Description |
|---|---|
ElementType |
Exact, non-array, non-cv object type, nothrow constructible from
ArgumentTypes and nothrow destructible. Convert the owner to a const view afterwards through the explicit adapter if needed. |
| Parameter | Description |
|---|---|
domain |
Allocation domain for the object. Borrowed; it must outlive the returned owner.
|
inoutOwner |
Output owner. Must be empty on entry. Written only on
Ok; every other status leaves it unchanged. |
arguments |
Constructor arguments, forwarded only after allocation succeeds.
|
Returns
Ok with inoutOwner holding the object; InvalidState if inoutOwner was not empty; TooLarge if the layout cannot be requested; OutOfMemory if domain returned no storage. Note
domain's callbacks are; the output owner itself is not synchronized. Related types: AllocationDomain · DomainDeleter · UniquePtr · OwnershipStatus
Declared in modules/foundation/memory/include/ludus/foundation/memory/owned_object.hpp
TryMakeShared¶
template <typename ElementType, typename... ArgumentTypes>
OwnershipStatus ludus::foundation::TryMakeShared(const AllocationDomain &domain, SharedPtr< ElementType > &inoutOwner, ArgumentTypes &&... arguments) noexcept
requires (std::is_object_v<ElementType> && std::is_array_v<ElementType> == false && std::is_same_v<ElementType, std::remove_cv_t<ElementType>> && std::is_nothrow_constructible_v<ElementType, ArgumentTypes&&...> && std::is_nothrow_destructible_v<ElementType>)
domain and writes its owner. usize arithmetic, request one allocation aligned for both the controller and ElementType (including over-aligned types), and only then forward arguments to the constructor. Allocation failure therefore never consumes move arguments. The object is destroyed by its exact type when the last strong owner releases it, and the block is freed through domain with its original layout when the last weak hold releases it.| Template parameter | Description |
|---|---|
ElementType |
Exact, non-array, non-cv object type, nothrow constructible from
ArgumentTypes and nothrow destructible. Convert the owner to a const or base view afterwards if needed. |
| Parameter | Description |
|---|---|
domain |
Allocation domain for the combined block. Borrowed; it, its callback context and this code must outlive every strong owner and weak observer of the result.
|
inoutOwner |
Output owner. Must be empty on entry. Written only on
Ok; every other status leaves it unchanged. |
arguments |
Constructor arguments, forwarded only after allocation succeeds.
|
Returns
Ok with inoutOwner holding the object; InvalidState if inoutOwner was not empty; TooLarge if the combined layout cannot be requested; OutOfMemory if domain returned no storage. Note
domain's callbacks are; the output owner itself is not synchronized. Related types: AllocationDomain · SharedPtr · OwnershipStatus
Declared in modules/foundation/memory/include/ludus/foundation/memory/shared_ptr.hpp
CreateShared¶
StringStatus ludus::foundation::CreateShared(std::string_view value, const AllocationDomain &domain, SharedString &output)
value once into a new shared block allocated from domain and stores it in output. value makes output empty without allocating or recording domain. Otherwise the header and bytes are one allocation. On success output releases its previous block. Output unchanged on failure, even when source borrows the old output. | Parameter | Description |
|---|---|
value |
Bytes to copy; it may borrow
output's current bytes. |
domain |
Domain for the block; borrowed and must outlive every handle that shares it.
|
output |
Receives the new handle.
|
Returns
domain cannot supply the block. Related types: AllocationDomain · SharedString · StringStatus
Declared in modules/foundation/strings/include/ludus/foundation/strings/shared_string.hpp
CopyToString¶
StringStatus ludus::foundation::CopyToString(const SharedString &value, String &output) noexcept
output, as String::TryAssign. output keeps its own allocation domain, so the copy is independent of the shared block's domain. Returns
output's domain cannot supply the storage. Failure leaves output unchanged. Related types: SharedString · String · StringStatus
Declared in modules/foundation/strings/include/ludus/foundation/strings/shared_string.hpp
CreateTable¶
StringStatus ludus::foundation::CreateTable(const StringTableConfig &config, const AllocationDomain &domain, StringTable &outTable)
outTable required; failure preserves it. config is copied; domain is borrowed and must outlive the table and its frozen owner. | Parameter | Description |
|---|---|
config |
Budgets, hash policy and spelling rules.
|
domain |
Allocation source for the table state, entries, lookup metadata and spelling bytes.
|
outTable |
Receives the new table on success; must be empty.
|
Returns
outTable is not empty, MaxEntries is zero or StringIndex::INVALID_VALUE, MaxAllocatedBytes cannot hold the table state, MaxSpellingBytes reaches half the usize range, HashPolicy is not an enumerator, or Untrusted lacks HasSecretKey; OutOfMemory when the domain fails; CapacityExceeded when the byte budget cannot hold the empty entry; or TokenExhausted after the process has issued every token. Failure releases everything allocated. Related types: AllocationDomain · StringTable · StringStatus · StringTableConfig
Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp
ValidateUtf8¶
StringStatus ludus::foundation::ValidateUtf8(std::string_view bytes, Utf8View &output, usize &errorOffset)
bytes is well-formed UTF-8 (Unicode Standard, section 3.9, table 3-7). | Parameter | Description |
|---|---|
bytes |
Bytes to validate; borrowed by
output on success. |
output |
Receives the proof on success.
|
errorOffset |
On failure, byte offset at which the first ill-formed sequence starts.
|
Returns
Related types: Utf8View · StringStatus · usize
Declared in modules/foundation/strings/include/ludus/foundation/strings/utf8.hpp
ValidateCString¶
StringStatus ludus::foundation::ValidateCString(std::string_view bytes) noexcept
bytes contains no zero byte, so it can cross a C-string boundary intact. bytes. Pass a separately terminated copy (such as String::GetData) to the C API. Returns
bytes is zero. Related types: StringStatus
Declared in modules/foundation/strings/include/ludus/foundation/strings/utf8.hpp
TryReadBigEndian¶
template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryReadBigEndian(std::span< const uint8 > bytes, ValueType &out) noexcept
Related types: uint8
Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp
TryReadLittleEndian¶
template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryReadLittleEndian(std::span< const uint8 > bytes, ValueType &out) noexcept
Related types: uint8
Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp
TryWriteBigEndian¶
template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryWriteBigEndian(ValueType value, std::span< uint8 > bytes) noexcept
Related types: uint8
Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp
TryWriteLittleEndian¶
template <UnsignedInteger ValueType>
constexpr bool ludus::foundation::core::TryWriteLittleEndian(ValueType value, std::span< uint8 > bytes) noexcept
Related types: uint8
Declared in modules/foundation/base/include/ludus/foundation/base/byte_order.hpp
TryAdd¶
template <Integer ValueType>
constexpr bool ludus::foundation::core::TryAdd(ValueType left, ValueType right, ValueType &outValue) noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp
TryIntegerCast¶
template <Integer DestinationType, Integer SourceType>
constexpr bool ludus::foundation::core::TryIntegerCast(SourceType value, DestinationType &outValue) noexcept
Returns
Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp
TryMultiply¶
template <Integer ValueType>
constexpr bool ludus::foundation::core::TryMultiply(ValueType left, ValueType right, ValueType &outValue) noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp
TrySubtract¶
template <Integer ValueType>
constexpr bool ludus::foundation::core::TrySubtract(ValueType left, ValueType right, ValueType &outValue) noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/checked_integer.hpp
Forward¶
template <typename ValueType>
constexpr ValueType && ludus::foundation::core::Forward(std::remove_reference_t< ValueType > &value) noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/core.h
Move¶
template <typename ValueType>
constexpr std::remove_reference_t< ValueType > && ludus::foundation::core::Move(ValueType &&value) noexcept
Declared in modules/foundation/base/include/ludus/foundation/base/core.h