SDL3pp
A slim C++ wrapper for SDL3
Toggle main menu visibility
Loading...
Searching...
No Matches
SDL3pp
SDL3pp_guid.h
1
#ifndef SDL3PP_GUID_H_
2
#define SDL3PP_GUID_H_
3
4
#include <SDL3/SDL_guid.h>
5
#include "SDL3pp_stdinc.h"
6
7
namespace
SDL
{
8
19
21
using
GUIDRaw
= SDL_GUID;
22
23
// Forward decl
24
struct
GUID
;
25
43
struct
GUID
:
GUIDRaw
44
{
50
constexpr
GUID
(
const
GUIDRaw
& gUID = {})
noexcept
51
:
GUIDRaw
(gUID)
52
{
53
}
54
71
GUID
(StringParam pchGUID);
72
84
std::string
ToString
()
const
;
85
};
86
99
inline
std::string
GUIDToString
(
const
GUIDRaw
& guid)
100
{
101
std::string result(32,
' '
);
102
SDL_GUIDToString(guid, result.data(), 33);
103
return
result;
104
}
105
106
inline
std::string
GUID::ToString
()
const
{
return
SDL::GUIDToString
(*
this
); }
107
124
inline
GUID
StringToGUID
(
StringParam
pchGUID)
125
{
126
return
GUID
(std::move(pchGUID));
127
}
128
129
inline
GUID::GUID
(
StringParam
pchGUID)
130
:
GUIDRaw
(SDL_StringToGUID(pchGUID))
131
{
132
}
133
135
136
}
// namespace SDL
137
138
#endif
/* SDL3PP_GUID_H_ */
SDL::StringParam
Helpers to use C++ strings parameters.
Definition
SDL3pp_strings.h:43
SDL::GUIDRaw
SDL_GUID GUIDRaw
Alias to raw representation for GUID.
Definition
SDL3pp_guid.h:21
SDL::StringToGUID
GUID StringToGUID(StringParam pchGUID)
Convert a GUID string into a GUID structure.
Definition
SDL3pp_guid.h:124
SDL::GUIDToString
std::string GUIDToString(const GUIDRaw &guid)
Get an ASCII string representation for a given GUID.
Definition
SDL3pp_guid.h:99
SDL::GUID::ToString
std::string ToString() const
Get an ASCII string representation for a given GUID.
Definition
SDL3pp_guid.h:106
SDL
Main include header for the SDL3pp library.
SDL::GUID
An GUID is a 128-bit identifier for an input device that identifies that device across runs of SDL pr...
Definition
SDL3pp_guid.h:44
SDL::GUID::GUID
constexpr GUID(const GUIDRaw &gUID={}) noexcept
Wraps GUID.
Definition
SDL3pp_guid.h:50
Generated by
1.17.0