The Utility
interface provides utility functions. It
looks like this:
class UIMGUI_PUBLIC_API Utility
{
public:
static void sanitiseFilepath(FString& str) noexcept;
static void keyToText(FString& text, const uint16_t& key, bool bLong) noexcept;
static FString keyToText(const uint16_t& key, bool bLong) noexcept;
static void keyToText(FString& text, const InputAction& action, bool bLong) noexcept;
static FString keyToText(const InputAction& action, bool bLong) noexcept;
// DO NOT USE THIS, THIS IS ONLY HERE FOR INTERNAL REASONS!!! REALLY KNOW WHAT YOU'RE DOING WHEN USING THIS
static Global& getGlobal() noexcept;
static void removeConsole() noexcept;
static FString toLower(String str) noexcept;
static void toLower(FString& str) noexcept;
static FString toUpper(String str) noexcept;
static void toUpper(FString& str) noexcept;
static void sleep(uint64_t milliseconds) noexcept;
};
Reference for the functions:
toUpper
- Converts a string to all uppercase characterstoLower
- Converts a string to all lowercase charactersremoveConsole
- Removes the console window on WindowsgetGlobal
- Returns a reference to the internal global class, DO NOT TOUCH!!!keyToText
- Converts a key code to text in short or long form for usage in UIsanitizeFilepath
- Sanitizes file paths, such as replacing\
with/
on Windowssleep
- Puts the current thread to sleep for X milliseconds
Event safety
The whole interface is flagged as event safe at
Any time
.
C API
The C API is severely downsized, by removing most string operation functions. It uses the standard C API development rules as defined here. It looks like this:
// Event Safety - Any time
(UImGui_String str);
UIMGUI_PUBLIC_API UImGui_String UImGui_Utility_sanitiseFilepath
// Event Safety - Any time
(uint16_t key, bool bLong);
UIMGUI_PUBLIC_API UImGui_String UImGui_Utility_keyToText
// Event Safety - Any time
(UImGui_CInputAction* action, bool bLong);
UIMGUI_PUBLIC_API UImGui_String UImGui_Utility_keyToTextInputAction
// Event Safety - Any time
void UImGui_Utility_removeConsole();
UIMGUI_PUBLIC_API
// Event Safety - Any time
// Sleep for X milliseconds
void UImGui_Utility_sleep(uint64_t milliseconds); UIMGUI_PUBLIC_API
As can be seen, most keyToText
and all
toUpper
and toLower
functions are removed.
Since the C API is only available for the public API, the
getGlobal
function is also not available.
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Developer and contributor resources
- Misc