File include/brisk/core/BasicTypes.hpp¶
one function¶
template <typename T> std::span<T> one(T &value) noexcept
Creates a std::span representing a view over a single mutable element.
This function template constructs a std::span<T\> from a reference to a single element of type T.
The span provides read and write access to the element.
Template param T The type of the element.
Param value A reference to the element of type T. This element will be used to create the span.
Returns A std::span<T\> representing a view over the single element value.
The span has a size of 1 and points to the memory address of value.
template <typename T>
std::span<const T> one(const T &value) noexcept
Creates a std::span representing a view over a single immutable element.
This function template constructs a std::span<const T\> from a reference to a single constant element of
type T. The span provides read-only access to the element.
Template param T The type of the element.
Param value A reference to the constant element of type T. This element will be used to create the span.
Returns A std::span<const T\> representing a view over the single element value.
The span has a size of 1 and points to the memory address of value.
U8Char typedef¶
U8Char = char
Type alias for UTF-8 characters (fallback to ASCII character type).
U8String typedef¶
U8String = std::string
Type alias for UTF-8 strings (fallback to ASCII string type).
U8StringView typedef¶
U8StringView = std::string_view
Type alias for UTF-8 string views (fallback to ASCII string view type).
AsciiChar typedef¶
AsciiChar = char
Type alias for ASCII characters.
AsciiString typedef¶
AsciiString = std::string
Type alias for ASCII strings.
AsciiStringView typedef¶
AsciiStringView = std::string_view
Type alias for ASCII string views.
charIsUtf8 variable¶
constexpr inline bool charIsUtf8 = true
A constant indicating that the character type is UTF-8.
UChar16 typedef¶
UChar16 = char16_t
Type alias for UTF-16 characters.
UChar32 typedef¶
UChar32 = char32_t
Type alias for UTF-32 characters.
WChar typedef¶
WChar = wchar_t
Type alias for wide characters.
U16String typedef¶
U16String = std::u16string
Type alias for UTF-16 strings.
U16StringView typedef¶
U16StringView = std::u16string_view
Type alias for UTF-16 string views.
U32String typedef¶
U32String = std::u32string
Type alias for UTF-32 strings.
U32StringView typedef¶
U32StringView = std::u32string_view
Type alias for UTF-32 string views.
WString typedef¶
WString = std::wstring
Type alias for wide strings.
WStringView typedef¶
WStringView = std::wstring_view
Type alias for wide string views.
simpleMemoryRepresentation variable¶
template <typename T>
constexpr inline bool simpleMemoryRepresentation =
(std::has_unique_object_representations_v<T> ||
std::is_floating_point_v<T> ||
std::is_same_v<T, bool>) &&
(alignof(T) <= sizeof(T))
A compile-time constant determining if a type has a simple memory representation.
A type is considered to have a simple memory representation if it has unique object representations, is a floating-point type, or is a boolean type, and its alignment is less than or equal to its size.
asBytesView function¶
template <typename Type>
inline BytesView asBytesView(const Type &value)
requires simpleMemoryRepresentation<Type>
Converts an object of type T to a non-modifiable view of bytes.
This function requires that the type T has a simple memory representation.
Param value The object to convert.
Returns A BytesView representing the object as a sequence of bytes.
toBytesView function¶
template <typename Container,
typename T =
typename std::decay_t<Container>::value_type>
inline BytesView toBytesView(Container &&cont)
requires std::is_constructible_v<std::span<const T>,
Container &>
Converts a container to a non-modifiable view of bytes.
This function works for containers that may be converted to a std::span<const T\>.
Param cont The container to convert.
Returns A BytesView representing the container's elements as a sequence of bytes.
template <size_t N>
inline BytesView toBytesView(const char (&str)[N])
Converts a null-terminated C-string to a non-modifiable view of bytes.
Param str The null-terminated C-string to convert.
Returns A BytesView representing the C-string as a sequence of bytes, excluding null byte.
template <size_t N>
inline BytesView toBytesView(const char8_t (&str)[N])
Converts a null-terminated UTF-8 C-string to a non-modifiable view of bytes.
Param str The null-terminated UTF-8 C-string to convert.
Returns A BytesView representing the UTF-8 C-string as a sequence of bytes, excluding null byte.
template <size_t N>
inline BytesView toBytesView(const char16_t (&str)[N])
Converts a null-terminated UTF-16 C-string to a non-modifiable view of bytes.
Param str The null-terminated UTF-16 C-string to convert.
Returns A BytesView representing the UTF-16 C-string as a sequence of bytes, excluding null.
template <size_t N>
inline BytesView toBytesView(const char32_t (&str)[N])
Converts a null-terminated UTF-32 C-string to a non-modifiable view of bytes.
Param str The null-terminated UTF-32 C-string to convert.
Returns A BytesView representing the UTF-32 C-string as a sequence of bytes, excluding null.
template <size_t N>
inline BytesView toBytesView(const wchar_t (&str)[N])
Converts a null-terminated wide C-string to a non-modifiable view of bytes.
Param str The null-terminated wide C-string to convert.
Returns A BytesView representing the wide C-string as a sequence of bytes, excluding null.
toBytesMutableView function¶
template <typename Container>
inline BytesMutableView toBytesMutableView(Container &&cont)
requires requires
Converts a container to a modifiable view of bytes.
This function works for containers that may be converted to a std::span<T\>.
Param cont The container to convert.
Returns A BytesMutableView representing the container's elements as a sequence of bytes.
toBytes function¶
template <typename T> inline Bytes toBytes(T &&value)
Converts an object to a vector of bytes.
This function first converts the object to a BytesView, then creates a Bytes vector from it.
Param value The object to convert.
Returns A Bytes vector representing the object as a sequence of bytes.
toStringView function¶
template <typename T>
inline std::string_view toStringView(T &&value)
Converts an object to a std::string_view.
This function first converts the object to a BytesView, then creates a std::string_view from it.
Param value The object to convert.
Returns A std::string_view representing the object as a sequence of characters.
Encoding enum¶
enum class Encoding : uint8_t
EncodingEnum class representing different text encodings.
This enum class defines various text encodings that can be used to represent characters in a digital format.
Utf8 enumerator (Encoding::Utf8)¶
*/
Utf16 enumerator (Encoding::Utf16)¶
*/
Utf32 enumerator (Encoding::Utf32)¶
*/
defaultNames variable¶
template <>
inline constexpr std::initializer_list<
NameValuePair<Encoding>>
defaultNames<Encoding>
Names for the Encoding enum values.
safeCharPtr function¶
inline std::string_view safeCharPtr(const char *s)
Converts a const char* to a std::string_view, handling nullptr gracefully.
This function takes a pointer to a null-terminated C-string. If the pointer is non-null,
it returns a std::string_view that references the string. If the pointer is nullptr,
it returns a std::string_view with the value "(null)" to represent the absence of a string.
Param s A pointer to a null-terminated C-string. Can be nullptr.
Returns A std::string_view that either references the input C-string or is set to "(null)"
if the input pointer is nullptr.
Range class¶
template <typename T, bool inclusive = false> Range
A template class representing a range of values.
The Range class template defines a range with a minimum and maximum value of type T.
It provides various methods to perform operations such as calculating distance, union,
intersection, and checking if a value is contained within the range.
Template param T The type of the values in the range. It must support arithmetic operations.
min variable (Range::min)¶
T min
The minimum value of the range.
max variable (Range::max)¶
T max
The maximum value of the range.
distance function (Range::distance)¶
constexpr T distance() const noexcept
Computes the distance between the minimum and maximum values of the range.
Returns The distance between max and min.
union_ function (Range::union_)¶
constexpr Range union_(const Range &b) const noexcept
Computes the union of this range with another range.
The union of two ranges is a range that spans from the minimum of the two ranges
to the maximum of the two ranges.
Param b The other range to compute the union with.
Returns A new Range representing the union of this range and b.
intersection function (Range::intersection)¶
constexpr Range intersection(const Range &b) const noexcept
Computes the intersection of this range with another range.
The intersection of two ranges is a range that spans from the maximum of the two
ranges' minimums to the minimum of the two ranges' maximums. If the ranges do not
overlap, the result will be an empty range.
Param b The other range to compute the intersection with.
Returns A new Range representing the intersection of this range and b.
contains function (Range::contains)¶
constexpr bool contains(T value) const noexcept
Checks if a value is contained within the range.
Param value The value to check for containment.
Returns true if value is greater than or equal to min and less than max;
otherwise, false.
empty function (Range::empty)¶
constexpr bool empty() const noexcept
Checks if the range is empty.
A range is considered empty if max is less than or equal to min.
Returns true if max is less than or equal to min; otherwise, false.
intersects function (Range::intersects)¶
constexpr bool intersects(const Range &other) const noexcept
Checks if this range intersects with another range.
Two ranges intersect if their intersection is not empty.
Param other The other range to check for intersection.
Returns true if this range intersects with other; otherwise, false.
operator+ function (Range::operator+)¶
constexpr Range operator+(T b) const noexcept
Shifts the range by adding a value to both the minimum and maximum.
Param b The value to add to both min and max.
Returns A new Range that represents the shifted range.
operator- function (Range::operator-)¶
constexpr Range operator-(T b) const noexcept
Shifts the range by subtracting a value from both the minimum and maximum.
Param b The value to subtract from both min and max.
Returns A new Range that represents the shifted range.
operator+= function (Range::operator+=)¶
constexpr Range &operator+=(T b) noexcept
Increments both the minimum and maximum values of the range.
Param b The value to add to both min and max.
Returns A reference to the modified Range.
operator-= function (Range::operator-=)¶
constexpr Range &operator-=(T b) noexcept
Decrements both the minimum and maximum values of the range.
Param b The value to subtract from both min and max.
Returns A reference to the modified Range.
operator== function (Range::operator==)¶
constexpr bool
operator==(const Range &b) const noexcept = default
Checks for equality between this range and another range.
Param b The range to compare with.
Returns true if both min and max values are equal; otherwise, false.
RangeIterator class (Range::RangeIterator)¶
RangeIterator
A nested iterator class for the Range.
begin function (Range::begin)¶
RangeIterator begin() const noexcept
requires(!inclusive)
Returns an iterator to the beginning of the range.
Returns An iterator pointing to the minimum value.
end function (Range::end)¶
RangeIterator end() const noexcept
requires(!inclusive)
Returns an iterator to the end of the range.
The end iterator points just past the maximum value.
Returns An iterator pointing just past the maximum value.
Empty class¶
Empty
LambdaArgument class (InternalHelper::LambdaArgument)¶
template <typename F> LambdaArgument
template <typename R, typename A> LambdaArgument
template <typename R, typename A> LambdaArgument
RefAdapter class¶
template <typename Fn, typename Arg, typename Ret>
RefAdapter
MemberFieldTraits class¶
template <typename Func> MemberFieldTraits
template <typename Class_, typename Type_> MemberFieldTraits
TypeIds class¶
template <typename... T> TypeIds
Overload class¶
template <typename... Ts> Overload
range_format_kind class (fmt::range_format_kind)¶
template <typename T, bool inclusive, typename Char>
range_format_kind
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/