|
HDK
|
#include "UT_API.h"#include "UT_StringView.h"#include <SYS/SYS_Compiler.h>#include <SYS/SYS_Inline.h>#include <SYS/SYS_ParseNumber.h>#include <SYS/SYS_String.h>#include <SYS/SYS_Types.h>#include <tuple>#include <string.h>
Include dependency graph for UT_StringUtils.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| SYS_FORCE_INLINE bool | UTisstring (const char *s) |
| template<typename T , bool HasFastLength = true> | |
| SYS_NO_DISCARD_RESULT bool | UTstringStartsWith (const T &str, const char *prefix, bool case_sensitive=true, exint len=-1) |
| template<typename T > | |
| SYS_NO_DISCARD_RESULT bool | UTstringEndsWith (const T &str, const char *suffix, bool case_sensitive=true, exint len=-1) |
| template<typename T > | |
| SYS_NO_DISCARD_RESULT const char * | UTstringNumericSuffix (const T &str) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT UT_StringView | UTstringFileName (const StringT &str) |
| template<> | |
| SYS_NO_DISCARD_RESULT UT_StringView | UTstringFileName (const UT_StringView &str) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT std::tuple< UT_StringView, UT_StringView, UT_StringView > | UTstringSplitPath (const StringT &str) |
| Split the given path into the directory, filename, and file extension. More... | |
| template<> | |
| SYS_NO_DISCARD_RESULT std::tuple< UT_StringView, UT_StringView, UT_StringView > | UTstringSplitPath (const UT_StringView &str) |
| Split the given path into the directory, filename, and file extension. More... | |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT UT_StringView | UTstringFileExtension (const StringT &str) |
| template<> | |
| SYS_NO_DISCARD_RESULT UT_StringView | UTstringFileExtension< UT_StringView > (const UT_StringView &str) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT bool | UTstringMatchFileExtension (const StringT &str, const char *extension) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT int | UTstringCountChar (const StringT &str, int c) |
| template<> | |
| SYS_NO_DISCARD_RESULT int | UTstringCountChar< UT_StringView > (const UT_StringView &str, int c) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT bool | UTstringIsFloat (const StringT &str, bool skip_spaces=false, bool loose=false, bool allow_underscore=false) |
| template<> | |
| SYS_NO_DISCARD_RESULT bool | UTstringIsFloat< UT_StringView > (const UT_StringView &str, bool skip_spaces, bool loose, bool allow_underscore) |
| template<typename StringT > | |
| SYS_NO_DISCARD_RESULT bool | UTstringIsInteger (const StringT &str, bool skip_spaces=false) |
| template<> | |
| SYS_NO_DISCARD_RESULT bool | UTstringIsInteger< UT_StringView > (const UT_StringView &str, bool skip_spaces) |
| template<typename StringT > | |
| bool | UTstringParseNumberedFilename (const StringT &str, UT_StringView &prefix, UT_StringView &frame, UT_StringView &suffix, bool negative, bool fractional) |
| template<typename StringT > | |
| bool | UTstringParseNumberedFilename (const StringT &str, UT_StringHolder &prefix, UT_StringHolder &frame, UT_StringHolder &suffix, bool negative, bool fractional) |
| template<typename StringT > | |
| bool | UTstringIsQuoted (const StringT &str, char delimiter) |
| template<typename StringT , typename IntT > | |
| SYS_ParseStatus | UTstringToInt (const StringT &str, IntT &number, int base=0, SYS_ParseFlags flags=SYS_ParseFlags::None) |
| template<typename IntT , typename StringT > | |
| SYS_NO_DISCARD_RESULT IntT | UTstringToInt (const StringT &str, int base=0, SYS_ParseFlags flags=SYS_ParseFlags::None) |
| SYS_FORCE_INLINE bool UTisstring | ( | const char * | s | ) |
Definition at line 29 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT int UTstringCountChar | ( | const StringT & | str, |
| int | c | ||
| ) |
Definition at line 208 of file UT_StringUtils.h.
|
inline |
Definition at line 216 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT bool UTstringEndsWith | ( | const T & | str, |
| const char * | suffix, | ||
| bool | case_sensitive = true, |
||
| exint | len = -1 |
||
| ) |
Definition at line 59 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT UT_StringView UTstringFileExtension | ( | const StringT & | str | ) |
Definition at line 170 of file UT_StringUtils.h.
|
inline |
Definition at line 179 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT UT_StringView UTstringFileName | ( | const StringT & | str | ) |
Definition at line 100 of file UT_StringUtils.h.
|
inline |
Definition at line 109 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT bool UTstringIsFloat | ( | const StringT & | str, |
| bool | skip_spaces = false, |
||
| bool | loose = false, |
||
| bool | allow_underscore = false |
||
| ) |
Definition at line 239 of file UT_StringUtils.h.
|
inline |
Definition at line 337 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT bool UTstringIsInteger | ( | const StringT & | str, |
| bool | skip_spaces = false |
||
| ) |
Definition at line 350 of file UT_StringUtils.h.
|
inline |
Definition at line 387 of file UT_StringUtils.h.
| bool UTstringIsQuoted | ( | const StringT & | str, |
| char | delimiter | ||
| ) |
Definition at line 487 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT bool UTstringMatchFileExtension | ( | const StringT & | str, |
| const char * | extension | ||
| ) |
Definition at line 200 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT const char* UTstringNumericSuffix | ( | const T & | str | ) |
Definition at line 82 of file UT_StringUtils.h.
| bool UTstringParseNumberedFilename | ( | const StringT & | str, |
| UT_StringView & | prefix, | ||
| UT_StringView & | frame, | ||
| UT_StringView & | suffix, | ||
| bool | negative, | ||
| bool | fractional | ||
| ) |
Decompose a filename into various parts
parseNumberedFileName will breakup a filename into its various parts: file = prefix$Fsuffix (note: suffix is not the same as file extension.) 0 is returned if there is no frame number. 'negative' allows -[frame] to be interpreted as a negative number. 'fractional' allows [frame].[number] to be interpreted as a fractional frame.
WARNING: Make sure to take care of lifetimes when the input string is UT_StringView.
Definition at line 407 of file UT_StringUtils.h.
| bool UTstringParseNumberedFilename | ( | const StringT & | str, |
| UT_StringHolder & | prefix, | ||
| UT_StringHolder & | frame, | ||
| UT_StringHolder & | suffix, | ||
| bool | negative, | ||
| bool | fractional | ||
| ) |
Decompose a filename into various parts
parseNumberedFileName will breakup a filename into its various parts: file = prefix$Fsuffix (note: suffix is not the same as file extension.) 0 is returned if there is no frame number. 'negative' allows -[frame] to be interpreted as a negative number. 'fractional' allows [frame].[number] to be interpreted as a fractional frame.
| SYS_NO_DISCARD_RESULT std::tuple<UT_StringView, UT_StringView, UT_StringView> UTstringSplitPath | ( | const StringT & | str | ) |
Split the given path into the directory, filename, and file extension.
Definition at line 127 of file UT_StringUtils.h.
|
inline |
Split the given path into the directory, filename, and file extension.
Definition at line 137 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT bool UTstringStartsWith | ( | const T & | str, |
| const char * | prefix, | ||
| bool | case_sensitive = true, |
||
| exint | len = -1 |
||
| ) |
Definition at line 33 of file UT_StringUtils.h.
| SYS_ParseStatus UTstringToInt | ( | const StringT & | str, |
| IntT & | number, | ||
| int | base = 0, |
||
| SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
| ) |
Definition at line 498 of file UT_StringUtils.h.
| SYS_NO_DISCARD_RESULT IntT UTstringToInt | ( | const StringT & | str, |
| int | base = 0, |
||
| SYS_ParseFlags | flags = SYS_ParseFlags::None |
||
| ) |
Definition at line 511 of file UT_StringUtils.h.