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

Reference for Environment. More...

Inheritance diagram for SDL::EnvironmentRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::EnvironmentRef:
Collaboration graph
[legend]

Public Member Functions

constexpr EnvironmentRef (EnvironmentRaw resource) noexcept
 Constructs from raw Environment. More...
 
constexpr EnvironmentRef (const Environment &resource) noexcept
 Constructs from Environment. More...
 
constexpr EnvironmentRef (Environment &&resource) noexcept
 Constructs from Environment. More...
 
constexpr EnvironmentRef (const EnvironmentRef &other) noexcept
 Copy constructor.
 
constexpr EnvironmentRef (EnvironmentRef &&other) noexcept
 Move constructor.
 
 ~EnvironmentRef ()
 Destructor.
 
EnvironmentRefoperator= (const EnvironmentRef &other) noexcept
 Assignment operator.
 
constexpr operator EnvironmentRaw () const noexcept
 Converts to EnvironmentRaw.
 
constexpr Environment (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr Environment (EnvironmentRaw resource) noexcept
 Constructs from raw Environment. More...
 
constexpr Environment (const Environment &other) noexcept=delete
 Copy constructor.
 
constexpr Environment (Environment &&other) noexcept
 Move constructor.
 
constexpr Environment (const EnvironmentRef &other)=delete
 
constexpr Environment (EnvironmentRef &&other)=delete
 
 Environment (bool populated)
 Create a set of environment variables. More...
 
- Public Member Functions inherited from SDL::Environment
constexpr Environment (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr Environment (EnvironmentRaw resource) noexcept
 Constructs from raw Environment. More...
 
constexpr Environment (const Environment &other) noexcept=delete
 Copy constructor.
 
constexpr Environment (Environment &&other) noexcept
 Move constructor.
 
constexpr Environment (const EnvironmentRef &other)=delete
 
constexpr Environment (EnvironmentRef &&other)=delete
 
 Environment (bool populated)
 Create a set of environment variables. More...
 
 ~Environment ()
 Destructor.
 
constexpr Environmentoperator= (Environment &&other) noexcept
 Assignment operator.
 
Environmentoperator= (const Environment &other)=delete
 Assignment operator.
 
constexpr EnvironmentRaw get () const noexcept
 Retrieves underlying EnvironmentRaw.
 
constexpr EnvironmentRaw release () noexcept
 Retrieves underlying EnvironmentRaw and clear this.
 
constexpr auto operator<=> (const Environment &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
void Destroy ()
 Destroy a set of environment variables. More...
 
const char * GetVariable (StringParam name)
 Get the value of a variable in the environment. More...
 
OwnArray< char * > GetVariables ()
 Get all variables in the environment. More...
 
Uint64 GetVariableCount ()
 Get the Variables count. More...
 
void SetVariable (StringParam name, StringParam value, bool overwrite)
 Set the value of a variable in the environment. More...
 
void UnsetVariable (StringParam name)
 Clear a variable from the environment. More...
 

Detailed Description

This does not take ownership!

Constructor & Destructor Documentation

◆ EnvironmentRef() [1/3]

constexpr SDL::EnvironmentRef::EnvironmentRef ( EnvironmentRaw  resource)
inlineconstexprnoexcept
Parameters
resourcea EnvironmentRaw.

This does not takes ownership!

◆ EnvironmentRef() [2/3]

constexpr SDL::EnvironmentRef::EnvironmentRef ( const Environment resource)
inlineconstexprnoexcept
Parameters
resourcea Environment.

This does not takes ownership!

◆ EnvironmentRef() [3/3]

constexpr SDL::EnvironmentRef::EnvironmentRef ( Environment &&  resource)
inlineconstexprnoexcept
Parameters
resourcea Environment.

This will release the ownership from resource!

Member Function Documentation

◆ Environment() [1/2]

SDL::Environment::Environment ( bool  populated)
inline
Parameters
populatedtrue to initialize it from the C runtime environment, false to create an empty environment.
Postcondition
a pointer to the new environment or nullptr on failure; call GetError() for more information.
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
Environment.GetVariable
Environment.GetVariables
Environment.SetVariable
Environment.UnsetVariable
Environment.Destroy

◆ Environment() [2/2]

constexpr SDL::Environment::Environment ( EnvironmentRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea EnvironmentRaw to be wrapped.

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


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