SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SDL::Properties Class Reference

SDL properties ID. More...

Inheritance diagram for SDL::Properties:
Inheritance graph
[legend]

Public Member Functions

constexpr Properties ()=default
 Default ctor.
 
constexpr Properties (const PropertiesID resource)
 Constructs from PropertiesParam. More...
 
constexpr Properties (const Properties &other)=delete
 Copy constructor.
 
constexpr Properties (Properties &&other)
 Move constructor.
 
constexpr Properties (const PropertiesRef &other)=delete
 
constexpr Properties (PropertiesRef &&other)=delete
 
 ~Properties ()
 Destructor.
 
Propertiesoperator= (Properties other)
 Assignment operator.
 
constexpr PropertiesID get () const
 Retrieves underlying PropertiesID.
 
constexpr PropertiesID release ()
 Retrieves underlying PropertiesID and clear this.
 
constexpr auto operator<=> (const Properties &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator PropertiesParam () const
 Converts to PropertiesParam.
 
void Destroy ()
 Destroy a group of properties. More...
 
void Lock ()
 Lock a group of properties. More...
 
void Unlock ()
 Unlock a group of properties. More...
 
void SetPointerProperty (StringParam name, void *value)
 Set a pointer property in a group of properties. More...
 
void SetStringProperty (StringParam name, StringParam value)
 Set a string property in a group of properties. More...
 
void SetNumberProperty (StringParam name, Sint64 value)
 Set an integer property in a group of properties. More...
 
void SetFloatProperty (StringParam name, float value)
 Set a floating point property in a group of properties. More...
 
void SetBooleanProperty (StringParam name, bool value)
 Set a boolean property in a group of properties. More...
 
bool HasProperty (StringParam name) const
 Return whether a property exists in a group of properties. More...
 
PropertyType GetPropertyType (StringParam name) const
 Get the type of a property in a group of properties. More...
 
void * GetPointerProperty (StringParam name, void *default_value) const
 Get a pointer property from a group of properties. More...
 
const char * GetStringProperty (StringParam name, StringParam default_value) const
 Get a string property from a group of properties. More...
 
Sint64 GetNumberProperty (StringParam name, Sint64 default_value) const
 Get a number property from a group of properties. More...
 
float GetFloatProperty (StringParam name, float default_value) const
 Get a floating point property from a group of properties. More...
 
bool GetBooleanProperty (StringParam name, bool default_value) const
 Get a boolean property from a group of properties. More...
 
void ClearProperty (StringParam name) const
 Clear a property from a group of properties. More...
 
void Enumerate (EnumeratePropertiesCB callback) const
 Enumerate the properties contained in a group of properties. More...
 
void Enumerate (EnumeratePropertiesCallback callback, void *userdata) const
 Enumerate the properties contained in a group of properties. More...
 
Uint64 GetCount () const
 Returns the number of properties this has. More...
 

Static Public Member Functions

static Properties Create ()
 Create a group of properties. More...
 

Detailed Description

Since
This datatype is available since SDL 3.2.0.
Category:
Resource
See also
Properties.Create

Constructor & Destructor Documentation

◆ Properties()

constexpr SDL::Properties::Properties ( const PropertiesID  resource)
inlineexplicitconstexpr
Parameters
resourcea PropertiesID to be wrapped.

This assumes the ownership, call release() if you need to take back.

Member Function Documentation

◆ Enumerate()

void SDL::Properties::Enumerate ( EnumeratePropertiesCB  callback) const

The callback function is called for each property in the group of properties. The properties are locked during enumeration.

Parameters
callbackthe function to call for each property.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.

The documentation for this class was generated from the following file: