![]() |
Phasor 3.3.0
Stack VM based Programming Language
|
#include <print>#include <string>#include <format>#include <unordered_map>#include <cstdlib>#include <enum_array>#include <unistd.h>Go to the source code of this file.
Enumerations | |
| enum class | EConsentVolition { Might , WouldLike , Wants , Needs , HasTo , Must } |
| Priority level for the prompt_consent permission request. More... | |
Functions | |
| template<size_t N1, size_t N2, size_t N3> | |
| bool | prompt_consent (const char(&subsystem)[N1], EConsentVolition volition, const char(&verb)[N2], const char(&noun)[N3], bool default_val=false) |
| Prompt the user for consent. | |
Variables | |
| static constexpr enum_array< EConsentVolition, std::string_view, 6 > | AConsentVolition |
| Array for the EConsentVolition enum. | |
|
strong |
Priority level for the prompt_consent permission request.
| Enumerator | |
|---|---|
| Might | |
| WouldLike | |
| Wants | |
| Needs | |
| HasTo | |
| Must | SHOULD ONLY BE USED IF IT WILL END THE PROGRAM ON FALSE. |
Definition at line 25 of file userconsent.h.
|
inline |
Prompt the user for consent.
| subsystem | The string literal denoting the subsystem requesting consent |
| volition | The priority level of the request |
| verb | The string literal denoting the action being requested |
| noun | The string literal denoting the object being acted upon |
| default_val | The default value if the user doesn't respond |
The function will check if a TTY is present, if not, GUI fallbacks (e.g. WindowsAPI, AppleCF, zenity/kdialog) will be attempted, returning false on failure.
Definition at line 56 of file userconsent.h.
|
staticconstexpr |
Array for the EConsentVolition enum.
Definition at line 35 of file userconsent.h.