|
| std::string | HttpDateToISO8601 (const std::string &httpDate) |
| | Converts a date from HTTP-Date to ISO8601 format.
|
| |
| StringArray | getVersionSegments (StringRef p) |
| |
| int | getVersionAsHexIntegerFromParts (const StringArray &segments) |
| |
| int | getVersionAsHexInteger (StringRef versionString) |
| |
| static bool | compareFloats (const float &a, const float &b) |
| |
| String | ellipsizeStringToWidth (const Font &font, const String &input, const int maxWidth) |
| | Cuts the center out of a String to make it fit a given pixel width.
|
| |
| String | convertFilePathString (const String &path) |
| | Converts a file path passed as a raw string, to the current platform. Has no effect if the path is already valid for the current OS. (Win + Mac only)
|
| |
| void | hexStringToByteArray (const std::string &input, std::vector< unsigned char > &byteArray) |
| | Converts a hex string to a byte array.
|
| |
| template<class... Args> |
| String | StringsIntoPath (Args... args) |
| | Joins multiple string arguments into a path string.
|
| |
| String krotos::utils::ellipsizeStringToWidth |
( |
const Font & | font, |
|
|
const String & | input, |
|
|
const int | maxWidth ) |
Cuts the center out of a String to make it fit a given pixel width.
Taking into account the kerning and character widths of the supplied Font, if the calculated input string width in pixels exceeds the supplied maxWidth, then enough characters are removed from the center of the string (and replaced with an ellipsis) to make it fit within maxWidth. The fit may be slightly short of the given max, depending on the exact width of the characters at the breaks. It will never be wider.
- Parameters
-
| font | Reference to the font which will be used to render the string |
| input | Reference to the string to be fitted |
| maxWidth | Maximum width in pixels for the string to occupy |
- Returns
- Reduced size string with center ellipsis.