psl namespace

paradigm standard library

contains various utilities and constructs to aid you. In this you'll find constructs that allow event signalling, dealing with UTF encoded strings, etc...

namespaces

concepts
Utility concepts.
ecs
Entity Component System.
math
conversions
meta
contains utilities to identify types and instances at runtime and on disk.
string16
UTF-16 class namespace that contains the typedefs for the string objects, as well as helper methods.
string32
UTF-32 class namespace that contains the typedefs for the string objects, as well as helper methods.
string8
UTF-8 class namespace that contains the typedefs for the string objects, as well as helper methods.

classes

sparse_array<...>
container type that is fast to iterate, but has non-continuous interface
static_ring_array<...>
a deque-like interface implemented as an std::array<T, N> under the hood
UID
is an object holding a Unique IDentifier (UID)
view_ptr<...>
a non-owning 'smart' pointer type

typedefs

template<typename T, typename... Ts>
using has_type = utility::templates::has_type<T, Ts...>
checks if the given type exists within the variadic args
publicpublic
template<typename T, typename... Ts>
using index_of = utility::templates::index_of<T, Ts...>
retrieve the index of the type in the variadic args
publicpublic
template<size_t N, typename... Ts>
using type_at_index = utility::templates::type_at_index<N, Ts...>
get the type at the given index in the variadic args
publicpublic
template<size_t N, typename... Ts>
using type_at_index_t = typename type_at_index<N, Ts...>::type
get the type at the given index in the variadic args
publicpublic
template<typename... Ts>
using type_pack_t = utility::templates::type_pack_t<Ts...>
used to store packs of types to pass around as parameters without instantiating the type's objects
publicpublic
template<typename T>
using container_to_type_pack_t = utility::templates::container_to_type_pack_t<T>
transforms a container like type (like tuple, or pair) into a psl::type_pack_t
publicpublic
using stringstream = string8::stream
platform conditional string type, turns into char or wchar depending on the platform and compile options
publicpublic
using pchar_t = platform::char_t
platform conditional string type, turns into char or wchar depending on the platform and compile options
publicpublic

functions

to_string8_t
converts a psl::string into a UTF-8 string.
public
from_string8_t
converts a UTF-8 string into a psl::string
public
to_string8_t
converts a psl::string into a UTF-8 string.
public
from_string8_t
converts a UTF-8 string into a psl::string
public
to_pstring
converts a psl::string8_t int a psl::pstring
public
to_pstring
converts a psl::string int a psl::pstring
public
memset
std::memset wrapper that auto-converts to std::wmemset when wchar == psl::char_t
public
popen
wrapper for the platform specific popen command, changes its internals depending on psl::char_t size.
public
pclose
wrapper around pclose.
public
memcpy_s
wrapper around std::memcpy that changes behaviour depending on the size of psl::char_t.
public
strlen
wrapper around strlen that changes behaviour depending on the size of psl::char_t.
public
fprintf<…>
wrapper around fprintf that changes behaviour depending on the size of psl::char_t.
public
printf<…>
wrapper around printf that changes behaviour depending on the size of psl::char_t.
public

variables

auto
index_of_v<...>
retrieve the index of the type in the variadic args
constexprconstexprpublicpublicstaticstatic
auto
type_pack_size_v<...>
retrieve the size of a type pack
constexprconstexprpublicpublicstaticstatic
auto
container_has_type_v<...>
checks if the container's template arguments contains the given type.
constexprconstexprpublicpublicstaticstatic

concepts

psl::HasType checks if the given type exists within the variadic args
psl::HasType checks if the given type exists within the variadic args

Typedef documentation

template<typename T, typename... Ts>
using psl::has_type = utility::templates::has_type<T, Ts...>

checks if the given type exists within the variadic args

Template parameters
T type to search
Ts types to match against

template<typename T, typename... Ts>
using psl::index_of = utility::templates::index_of<T, Ts...>

retrieve the index of the type in the variadic args

Template parameters
T type to find the index of
Ts types to match against

template<size_t N, typename... Ts>
using psl::type_at_index = utility::templates::type_at_index<N, Ts...>

get the type at the given index in the variadic args

Template parameters
N index to retrieve
Ts types to select from

template<size_t N, typename... Ts>
using psl::type_at_index_t = typename type_at_index<N, Ts...>::type

get the type at the given index in the variadic args

Template parameters
N index to retrieve
Ts types to select from

template<typename... Ts>
using psl::type_pack_t = utility::templates::type_pack_t<Ts...>

used to store packs of types to pass around as parameters without instantiating the type's objects

Template parameters
Ts types to store

template<typename T>
using psl::container_to_type_pack_t = utility::templates::container_to_type_pack_t<T>

transforms a container like type (like tuple, or pair) into a psl::type_pack_t

Template parameters
T target container to transform

Function documentation

psl::string8_t psl::to_string8_t(const psl::string& s)

Brief

converts a psl::string into a UTF-8 string.

Details

converts a psl::string into a UTF-8 string, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::string8_t based on the input psl::string.

psl::string psl::from_string8_t(const psl::string8_t& s)

Brief

converts a UTF-8 string into a psl::string

Details

converts a UTF-8 string into a psl::string, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::string based on the input UTF-8 string.

psl::string8_t psl::to_string8_t(psl::string_view s)

Brief

converts a psl::string into a UTF-8 string.

Details

converts a psl::string into a UTF-8 string, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::string8_t based on the input psl::string.

psl::string psl::from_string8_t(psl::string8::view s)

Brief

converts a UTF-8 string into a psl::string

Details

converts a UTF-8 string into a psl::string, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::string based on the input UTF-8 string.

psl::pstring_t psl::to_pstring(const psl::string8_t& s)

Brief

converts a psl::string8_t int a psl::pstring

Details

converts a psl::string int a psl::pstring

converts a psl::string8_t into a psl::pstring, depending on the bit-size (8 or 16) of psl::string this turns into a no-op. converts a psl::string into a psl::pstring, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::pstring_t based on the input psl::string.

psl::pstring_t psl::to_pstring(psl::string8::view s)

Brief

converts a psl::string int a psl::pstring

Details

converts a psl::string into a psl::pstring, depending on the bit-size (8 or 16) of psl::string this turns into a no-op. converts a psl::string into a psl::pstring, depending on the bit-size (8 or 16) of psl::string this turns into a no-op.

Parameters
in string to convert.
Returns a psl::pstring_t based on the input psl::string.

void* psl::memset(char_t* _Dst, char_t _Val, size_t _Size)

Brief

std::memset wrapper that auto-converts to std::wmemset when wchar == psl::char_t

Parameters
_Dst in destination location of what to memset
_Val in the value to set the _Dst to.
_Size in how many times this should be repeated.
Returns the location on success, or a nullptr on failure.

FILE* psl::popen(const char_t* _Command, const char_t* _Mode)

Brief

wrapper for the platform specific popen command, changes its internals depending on psl::char_t size.

Details

Parameters
_Command in the command to execute.
_Mode in mode of the returned stream.
Returns a FILE* handle on success.

int psl::pclose(FILE* _Stream)

Brief

wrapper around pclose.

Details

Parameters
_Stream in the FILE* handle you wish to close.
Returns a platform specific success code depending on what happened.

char_t* psl::memcpy_s(char_t*const _Destination, char_t const*const _Source, size_t const _SourceSize)

Brief

wrapper around std::memcpy that changes behaviour depending on the size of psl::char_t.

Parameters
_Destination in the destination to memcpy to.
_Source in the source to memcpy from.
_SourceSize in the amount of bytes to copy from the source.

size_t psl::strlen(const char_t* _Str)

Brief

wrapper around strlen that changes behaviour depending on the size of psl::char_t.

Details

Parameters
_Str in the target string to count.
Returns the size of the string.

template<typename... Args>
void psl::fprintf(FILE*const _Stream, char_t const* _Format, Args && ... args)

Brief

wrapper around fprintf that changes behaviour depending on the size of psl::char_t.

Parameters
_Stream in pointer to a FILE object that identifies an output stream.
_Format in text you wish to write to the stream, with optional formatting instructions.
args in stream of variables you wish to send to forward to fprintf, the behaviour is unchanged.

template<typename... Args>
void psl::printf(char_t const* _Format, Args && ... args)

Brief

wrapper around printf that changes behaviour depending on the size of psl::char_t.

Parameters
_Format in text you wish to write to the stream, with optional formatting instructions.
args in stream of variables you wish to send to forward to fprintf, the behaviour is unchanged.

Variable documentation

template<typename T, typename... Ts>
static auto psl::index_of_v constexpr

retrieve the index of the type in the variadic args

Template parameters
T type to find the index of
Ts types to match against

template<typename T>
static auto psl::type_pack_size_v constexpr

retrieve the size of a type pack

Template parameters
T the type pack you want to extract the size from

template<typename T, typename Container>
static auto psl::container_has_type_v constexpr

checks if the container's template arguments contains the given type.

Template parameters
T the type to search for.
Container container type to search in.