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

Handle to an owned environment. More...

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

Public Member Functions

void Destroy ()
 Destroy a set of environment variables.
 
EnvironmentShared share ()
 Move this environment into a EnvironmentShared.
 
constexpr ResourceUnique (std::nullptr_t=nullptr)
 Default constructor.
 
constexpr ResourceUnique (base::value_type value, DELETER deleter={})
 Constructs from raw type.
 
constexpr ResourceUnique (ResourceUnique &&other)
 Move constructor.
 
 ResourceUnique (const ResourceUnique &other)=delete
 
- Public Member Functions inherited from SDL::ResourceUnique< EnvironmentRef >
constexpr ResourceUnique (std::nullptr_t=nullptr)
 Default constructor.
 
constexpr ResourceUnique (base::value_type value, DefaultDeleter< EnvironmentRef > deleter={})
 Constructs from raw type.
 
constexpr ResourceUnique (ResourceUnique &&other)
 Move constructor.
 
 ResourceUnique (const ResourceUnique &other)=delete
 
 ~ResourceUnique ()
 Destructor.
 
constexpr ResourceUniqueoperator= (ResourceUnique other)
 Assignment operator.
 
void reset ()
 Resets the value, destroying the resource if not nullptr.
 
- Public Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
RESOURCE release ()
 Returns reference and reset this.
 
- Public Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr operator bool () const
 Check if not null.
 
constexpr bool operator== (const ResourcePtrBase &other) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr reference operator* () const
 Gets reference.
 
constexpr const referenceoperator-> () const
 Gets addressable reference.
 
constexpr referenceoperator-> ()
 Gets addressable reference.
 
reference get () const
 Get reference.
 

Static Public Member Functions

static Environment Create (bool populated)
 Create a set of environment variables.
 

Additional Inherited Members

- Public Types inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
using deleter = DELETER
 The deleter type.
 
- Public Types inherited from SDL::ResourcePtrBase< RESOURCE >
using reference = RESOURCE
 The reference resource type.
 
using value_type = typename reference::value_type
 The raw resource type.
 
- Protected Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
constexpr ResourceOwnerBase (base::value_type value={}, DELETER deleter={})
 Constructs from raw type.
 
void free ()
 Frees resource.
 
- Protected Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr ResourcePtrBase (value_type value={})
 Constructs from raw type.
 
referenceget ()
 Get reference.
 

Detailed Description

Category:
Resource
See also
EnvironmentRef

Member Function Documentation

◆ Create()

static Environment SDL::Environment::Create ( bool  populated)
inlinestatic
Parameters
populatedtrue to initialize it from the C runtime environment, false to create an empty environment.
Returns
the new environment on success.
Exceptions
Erroron failure.
Thread safety:
If populated is false, it is safe to call this function from any thread, otherwise it is safe if no other threads are calling setenv() or unsetenv()
Since
This function is available since SDL 3.2.0.
See also
EnvironmentRef.GetVariable
EnvironmentRef.GetVariables
EnvironmentRef.SetVariable
EnvironmentRef.UnsetVariable
Environment.Destroy

◆ Destroy()

void SDL::Environment::Destroy ( )
inline
Thread safety:
It is safe to call this function from any thread, as long as the environment is no longer in use.
Since
This function is available since SDL 3.2.0.
See also
Environment.Create

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