Skip to content

Namespace endstone::detail

Namespace List > endstone > detail

Classes

Type Name
struct JoinView <typename It, typename Sentinel>
A lightweight, formattable view over a range that renders its elements separated by a delimiter.

Public Attributes

Type Name
Return(*)(Arg...) fp_cast
Gets the original member function pointer from a detour member function pointer (const, no ref-qualifier).

Public Functions

Type Name
void * fp_cast (Return(*)(Args...) fp)
Cast a function pointer to void pointer.
void * fp_cast (Return(Class::*)(Args...) fp)
Cast a member function pointer to void pointer.
Server & getServer ()
Gets the current Server singleton.
JoinView< It, Sentinel > join (It begin, Sentinel end, std::string_view sep)
auto join (const Range & range, std::string_view sep)
std::string quoted (std::string_view value)
Quotes and escapes a string the way the {:?} debug presentation does.

Public Attributes Documentation

variable fp_cast

Gets the original member function pointer from a detour member function pointer (const, no ref-qualifier).

Return(Class::*)(Arg...) endstone::detail::fp_cast(Return(Class::*fp)(Arg...) const, void *address);


Public Functions Documentation

function fp_cast

Cast a function pointer to void pointer.

template<typename Return, typename... Args>
void * endstone::detail::fp_cast (
    Return (*)(Args...) fp
) 

Template parameters:

  • Return The return type of the function.
  • Args The argument types of the function.

Parameters:

  • fp The function pointer to be casted.

Returns:

A void pointer to the function.


function fp_cast

Cast a member function pointer to void pointer.

template<typename Return, typename Class, typename... Args>
void * endstone::detail::fp_cast (
    Return (Class::*)(Args...) fp
) 

Cast a constant member function pointer to void pointer.

Template parameters:

  • Return The return type of the member function.
  • Class The class type that the member function belongs to.
  • Args The argument types of the member function.

Parameters:

  • fp Pointer to the member function to be casted.

Returns:

A void pointer to the member function.

Template parameters:

  • Return The return type of the constant member function.
  • Class The class type that the constant member function belongs to.
  • Args The argument types of the constant member function.

Parameters:

  • fp Pointer to the constant member function to be casted.

Returns:

A void pointer to the constant member function.


function getServer

Gets the current Server singleton.

inline Server & endstone::detail::getServer () 

Returns:

Server instance being run


function join

template<typename It, typename Sentinel>
JoinView < It , Sentinel > endstone::detail::join (
    It begin,
    Sentinel end,
    std::string_view sep
) 

function join

template<typename Range>
auto endstone::detail::join (
    const  Range & range,
    std::string_view sep
) 

function quoted

Quotes and escapes a string the way the {:?} debug presentation does.

inline std::string endstone::detail::quoted (
    std::string_view value
) 

std::format only gained the ? (debug) specifier in C++23, so this provides equivalent behaviour under C++20.



The documentation for this class was generated from the following file include/endstone/detail.h