Utility functions and classes. More...
Files | |
| file | Engine/src/Raven/Utils/Utility.h |
| Common string utility functions. | |
Functions | |
| std::wstring | Raven::Win32Helpers::Utf8ToUtf16 (std::string_view in) noexcept |
| Converts an UTF-8 String into a Wide UTF-16 string. | |
| std::string | Raven::Win32Helpers::Utf16ToUtf8 (std::wstring_view in) noexcept |
| Converts an UTF-16 String into a narrow UTF-8 string. | |
| void | Raven::Win32Helpers::SetProcessDpiAwareIfPossible () |
| Makes the process DPI aware if possible. | |
| std::string | Raven::FileDialogs::OpenFile (const char *filter) |
| Opens a native Windows file open dialog and returns the selected file path. | |
| std::string | Raven::FileDialogs::SaveFile (const char *filter) |
| Opens a native Windows file save dialog and returns the selected file path. | |
| bool | Raven::FileDialogs::OpenExplorer (const std::filesystem::path &path) |
| Opens the file explorer at the given Path. | |
| std::string | Raven::FileDialogs::OpenFolder () |
| Opens a native Windows folder browser dialog and returns the selected folder path. | |
| void | Raven::FileDialogs::OpenURL (const std::string &url) |
| Opens a the given URL in the default browser. | |
| void | Raven::Trim (std::string &str) |
| Removes leading and trailing whitespace from a string. | |
| void | Raven::Trim (std::wstring &str) |
| Removes leading and trailing whitespace from a wstring. | |
| std::string | Raven::ToLower (std::string_view str) |
| Converts a string view to lowercase. | |
| const char * | Raven::strcasestr (const char *haystack, const char *needle) noexcept |
| Performs a case-insensitive substring search. | |
| bool | Raven::ResolveWorkingDirectory (const std::string &dirPath) |
| Resolves the path to the working directory. | |
Utility functions and classes.
| CORE_API bool Raven::FileDialogs::OpenExplorer | ( | const std::filesystem::path & | path | ) |
Opens the file explorer at the given Path.
| path | The path at which to open the File Explorer |
| CORE_API std::string Raven::FileDialogs::OpenFile | ( | const char * | filter | ) |
Opens a native Windows file open dialog and returns the selected file path.
| filter | A Windows-style filter string (e.g. "Text Files\0*.txt\0All Files\0*.*\0"). |
| CORE_API std::string Raven::FileDialogs::OpenFolder | ( | ) |
Opens a native Windows folder browser dialog and returns the selected folder path.
| CORE_API void Raven::FileDialogs::OpenURL | ( | const std::string & | url | ) |
Opens a the given URL in the default browser.
| url | The URL which to open in the browser |
|
inline |
Resolves the path to the working directory.
| dirPath | The path to resolve. |
| CORE_API std::string Raven::FileDialogs::SaveFile | ( | const char * | filter | ) |
Opens a native Windows file save dialog and returns the selected file path.
| filter | A Windows-style filter string (e.g. "Text Files\0*.txt\0All Files\0*.*\0"). |
|
inline |
Makes the process DPI aware if possible.
|
inlinenoexcept |
Performs a case-insensitive substring search.
This function searches for the first occurrence of the substring needle in the string haystack, ignoring the case of both strings. If the substring is found, a pointer to the beginning of the substring in haystack is returned. If the substring is not found, the function returns nullptr.
| haystack | The string to be searched. |
| needle | The substring to search for. |
|
inline |
Converts a string view to lowercase.
| str | The input string view. |
|
inline |
Removes leading and trailing whitespace from a string.
| str | The string to trim. |
|
inline |
Removes leading and trailing whitespace from a wstring.
| str | The wstring to trim. |
|
inlinenoexcept |
Converts an UTF-16 String into a narrow UTF-8 string.
| in | The UTF-16 string to convert |
|
inlinenoexcept |
Converts an UTF-8 String into a Wide UTF-16 string.
| in | The UTF-8 string to convert |