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

math
conversions
meta
contains utilities to identify types and instances at runtime and on disk.
serialization
serialization primitives and helpers
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

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

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.