HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_StringWrap Class Reference

#include <UT_String.h>

+ Inheritance diagram for UT_StringWrap:

Public Member Functions

SYS_FORCE_INLINE UT_StringWrap (const char *str)
 
SYS_FORCE_INLINE ~UT_StringWrap ()
 
- Public Member Functions inherited from UT_String
SYS_FORCE_INLINE UT_String (const char *str=0)
 Construct UT_String from a C string, using shallow semantics. More...
 
 UT_String (const char *str, int deepCopy, int len=-1)
 
 UT_String (const std::string &str)
 Construct UT_String from a std::string, always doing a deep copy. The result will only be a UT_AlwaysDeep if the appropriate version is used, however! More...
 
 UT_String (const UT_StringHolder &str)
 Construct UT_String from a UT_StringHolder. This always duplicates and uses ALWAYS_DEEP semantics. More...
 
 UT_String (const UT_StringView &sv)
 Construct UT_String from a UT_StringView. This always duplicates and uses ALWAYS_DEEP semantics. More...
 
 UT_String (UT_AlwaysDeepType, const char *str=0)
 Construct UT_String from a C string, using ALWAYS_DEEP semantics. More...
 
 UT_String (UT_AlwaysDeepType, const std::string &str)
 Construct UT_String from a std::string, using ALWAYS_DEEP semantics. More...
 
 UT_String (const UT_String &str)
 
 ~UT_String ()
 
void setAlwaysDeep (bool deep)
 Make a string always deep. More...
 
bool isAlwaysDeep () const
 
void swap (UT_String &other)
 
bool isHard () const
 Returns whether this string is hardened already. More...
 
char * steal (void)
 
void saveBinary (std::ostream &os) const
 Save string to binary stream. More...
 
void saveAscii (std::ostream &os) const
 
void saveAscii (UT_OStream &os) const
 
void save (std::ostream &os, bool binary) const
 Save string to stream. Saves as binary if binary is true. More...
 
void save (UT_OStream &os, bool binary) const
 
bool load (UT_IStream &is)
 Load string from stream. Use is.eof() to check eof status. More...
 
void clear ()
 Reset the string to the default constructor. More...
 
void append (char ch)
 Append a character. More...
 
void append (const char *str, exint len=-1)
 Append a string or a section of a string. More...
 
void removeLast ()
 Remove the last character. More...
 
void truncate (exint len)
 Truncate the string at the Nth character. More...
 
UT_Stringoperator= (const UT_String &str)
 
UT_Stringoperator= (const char *str)
 
UT_Stringoperator= (const std::string &str)
 
UT_Stringoperator= (const UT_StringHolder &str)
 
UT_Stringoperator= (const UT_StringView &str)
 
UT_Stringoperator+= (const char *str)
 
UT_Stringoperator+= (const UT_String &str)
 
UT_Stringoperator+= (const UT_StringRef &str)
 
int compare (const char *str, bool case_sensitive=true) const
 
int compare (const UT_String &str, bool case_sensitive=true) const
 
int compare (const UT_StringRef &str, bool case_sensitive=true) const
 
bool equal (const char *str, bool case_sensitive=true) const
 
bool equal (const UT_String &str, bool case_sensitive=true) const
 
bool equal (const UT_StringRef &str, bool case_sensitive=true) const
 
bool operator== (const char *str) const
 
bool operator== (const UT_String &str) const
 
bool operator== (const UT_StringRef &str) const
 
bool operator!= (const char *str) const
 
bool operator!= (const UT_String &str) const
 
bool operator!= (const UT_StringRef &str) const
 
bool operator< (const char *str) const
 
bool operator< (const UT_String &str) const
 
bool operator< (const UT_StringRef &str) const
 
bool operator<= (const char *str) const
 
bool operator<= (const UT_String &str) const
 
bool operator<= (const UT_StringRef &str) const
 
bool operator> (const char *str) const
 
bool operator> (const UT_String &str) const
 
bool operator> (const UT_StringRef &str) const
 
bool operator>= (const char *str) const
 
bool operator>= (const UT_String &str) const
 
bool operator>= (const UT_StringRef &str) const
 
SYS_SAFE_BOOL operator bool () const
 Test whether the string is defined or not. More...
 
int distance (const char *str, bool case_sensitive=true, bool allow_subst=true) const
 
 operator const char * () const
 
 operator char * ()
 
const char * c_str () const
 
const char * buffer () const
 
const char * nonNullBuffer () const
 
char operator() (unsigned i) const
 
char & operator() (unsigned i)
 
void write (unsigned i, char c)
 
int toInt () const
 
fpreal toFloat () const
 
std::string toStdString () const
 
unsigned length (void) const
 Return length of string. More...
 
int64 getMemoryUsage (bool inclusive=true) const
 Return memory usage in bytes. More...
 
char * findChar (int c) const
 Find first occurrance of character. Returns NULL upon failure. More...
 
char * lastChar (int c) const
 Find last occurance of character. More...
 
int countChar (int c) const
 Return the number of occurrences of the specified character. More...
 
int count (const char *str, bool case_sensitive=true) const
 Count the occurrences of the string. More...
 
char * findNonSpace () const
 
const char * findWord (const char *word) const
 
bool findString (const char *str, bool fullword, bool usewildcards) const
 
int changeWord (const char *from, const char *to, int all=1)
 
int changeString (const char *from, const char *to, bool fullword)
 
int changeQuotedWord (const char *from, const char *to, int quote= '`', int all=1)
 
int findLongestCommonSuffix (const char *with)
 
int substr (UT_String &buf, int index, int len=0) const
 
unsigned isFloat (int skip_spaces=0, int loose=0, bool allow_underscore=false) const
 Determine if string can be seen as a single floating point number. More...
 
unsigned isInteger (int skip_spaces=0) const
 Determine if string can be seen as a single integer number. More...
 
void toUpper ()
 
void toLower ()
 
const char * fileName () const
 
const char * fileExtension () const
 Return the extension of a file path string. More...
 
bool matchFileExtension (const char *match_extension) const
 
UT_String pathUpToExtension () const
 
UT_String replaceExtension (const UT_String &new_ext) const
 Replace the file extension and return the new string. More...
 
void splitPath (UT_String &dir_name, UT_String &file_name) const
 
int parseNumberedFilename (UT_String &prefix, UT_String &frame, UT_String &suff, bool negative=true, bool fractional=false) const
 
bool isstring () const
 
int trimSpace (bool leaveSingleSpaceBetweenWords=false)
 
int trimBoundingSpace ()
 
int strip (const char *chars)
 
void protectString (bool protect_empty=false)
 
bool isQuotedString (char delimiter='\'') const
 
UT_String makeQuotedString (char delimiter='\'', bool escape_nonprinting=false) const
 
UT_String makeSmartQuotedString (char default_delimiter='\'', bool escape_nonprinting=false) const
 
void expandControlSequences (bool expand_extended=false)
 
bool hasWhiteSpace () const
 
void removeTrailingSpace ()
 
void removeTrailingChars (char chr)
 
void removeTrailingDigits ()
 
int cshParse (char *argv[], int maxArgs, void(*vlookup)(const char *, UT_String &)=UTvarLookup, void(*elookup)(const char *, UT_String &)=UTexprLookup, int *error=0, UT_StringCshIO *io=0)
 
int cshParse (UT_WorkArgs &argv, void(*vlookup)(const char *, UT_String &)=UTvarLookup, void(*elookup)(const char *, UT_String &)=UTexprLookup, int *error=0, UT_StringCshIO *io=0)
 
int dosParse (UT_WorkArgs &argv, bool preserve_backslashes=false)
 
int dosParse (char *argv[], int maxArgs, bool preserve_backslashes=false)
 
int parse (char *argv[], int maxArgs, const char *quotes="\"'", bool keep_quotes=false)
 
int parse (UT_WorkArgs &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int parseInPlace (char *argv[], int maxArgs, const char *quotes="\"'", bool keep_quotes=false)
 
int parseInPlace (UT_WorkArgs &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int tokenize (char *argv[], int maxArgs, char separator)
 
int tokenizeInPlace (char *argv[], int maxArgs, char separator)
 
int tokenize (UT_WorkArgs &argv, char separator)
 
int tokenizeInPlace (UT_WorkArgs &argv, char separator)
 
int tokenize (char *argv[], int maxArgs, const char *separators=" \t\n")
 
int tokenizeInPlace (char *argv[], int maxArgs, const char *separators=" \t\n")
 
int tokenize (UT_WorkArgs &argv, const char *separators=" \t\n")
 
int tokenizeInPlace (UT_WorkArgs &argv, const char *separators=" \t\n")
 
template<typename T >
int tokenize (T &list, const char *separators=" \t\n")
 
template<typename T >
int tokenizeInPlace (T &list, const char *separators=" \t\n")
 
void expandVariables ()
 
SYS_FORCE_INLINE uint32 hash () const
 
unsigned match (const char *pattern, int caseSensitive=1) const
 
unsigned matchFile (const char *pattern) const
 
unsigned matchPath (const char *pattern, int caseSensitive=1) const
 
unsigned multiMatch (const char *pattern, int caseSensitive, char separator) const
 
unsigned multiMatch (const char *pattern, int caseSensitive=1, const char *separators=", ", bool *explicitlyExcluded=0, int *matchIndex=0, ut_PatternRecord *pattern_record=NULL) const
 
unsigned multiMatch (const UT_StringMMPattern &pattern, bool *explicitlyExcluded=0, int *matchIndex=0, ut_PatternRecord *pattern_record=NULL) const
 
unsigned multiMatchRecord (const char *pattern, int maxpatterns, char *singles, int &nsingles, char **words, int &nwords, int case_sensitive=1, const char *separators=", ") const
 
unsigned multiMatchRecord (const UT_StringMMPattern &pattern, int maxpatterns, char *singles, int &nsingles, char **words, int &nwords) const
 
unsigned multiMatchRecord (const char *pattern, UT_StringHolder &singles, UT_StringArray &words, int case_sensitive=1, const char *separators=", ") const
 
bool matchPattern (const UT_WorkArgs &pattern_args, bool assume_match=false) const
 
bool contains (const char *pattern, bool case_sensitive=true) const
 
bool startsWith (const char *prefix, bool case_sensitive=true, exint len=-1) const
 
bool endsWith (const char *suffix, bool case_sensitive=true, exint len=-1) const
 
void pluralize ()
 
int traversePattern (int max, void *data, int(*func)(int num, int sec, void *data), unsigned int(*secfunc)(int num, void *data)=0, int offset=0) const
 
const char * fcontain (const char *pattern, bool case_sensitive=true) const
 
bool patternRename (const char *match_pattern, const char *replace)
 
const char * base (UT_String &buf) const
 
const char * suffix (void) const
 
void incrementNumberedName ()
 
std::ostream & setFormat (std::ostream &os)
 
int replacePrefix (const char *oldpref, const char *newpref)
 
int replaceSuffix (const char *oldsuffix, const char *newsuffix)
 
int expandArrays (char *names[], int max)
 
int format (int cols)
 
int substitute (const char *find, const char *replacement, bool all=true)
 
int substitute (char find, char replacement, bool all=true)
 
int replace (int pos, int len, const char *str)
 
int eraseHead (int len)
 
int eraseTail (int len)
 
int erase (int pos=0, int len=-1)
 
int insert (int pos, const char *str)
 
void extractProgramName (const char *path, bool strip_extension=true, bool normalize_path=true)
 
void normalizePath ()
 
void itoa (int64 i)
 
void utoa (uint64 i)
 
void itoa_pretty (int64 val)
 
void timeDeltaToPrettyString (double time_ms)
 
int sprintf (const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
 
int int forceValidVariableName (const char *safechars=NULL)
 
bool isValidVariableName (const char *safechars=NULL) const
 
bool forceAlphaNumeric ()
 
void getRelativePath (const char *src_fullpath, const char *dest_fullpath, bool file_path=false)
 
bool isAbsolutePath (bool file_path=false) const
 
bool collapseAbsolutePath (bool file_path=false)
 
bool truncateMiddle (int max_length)
 
bool applyCshModifiers (const char *modifiers)
 
UT_String removeRange ()
 
void formatByteSize (exint size, int digits=2)
 
int getCodePointCount () const
 
void getAsCodePoints (UT_Int32Array &cp_list) const
 Returns a list of Unicode code points from this string. More...
 
 UT_String (UT_String &&str) SYS_NOEXCEPT
 
UT_Stringoperator= (UT_String &&str)
 
void harden ()
 Take shallow copy and make it deep. More...
 
void harden (const char *s, int len=-1)
 Take shallow copy and make it deep. More...
 
void hardenIfNeeded ()
 Take shallow copy and make it deep. More...
 
void hardenIfNeeded (const char *s)
 Take shallow copy and make it deep. More...
 
void adopt (char *s)
 
void adopt (UT_String &str)
 
void adopt (UT_StringHolder &holder)
 
void prepend (const char *prefix)
 Prepend a string (or character) More...
 
void prepend (char ch)
 Prepend a string (or character) More...
 
char * findChar (const char *str) const
 Find first occurrance of any character in str. More...
 
char * findChar (const UT_String &str) const
 Find first occurrance of any character in str. More...
 

Additional Inherited Members

- Public Types inherited from UT_String
enum  UT_AlwaysDeepType { ALWAYS_DEEP }
 
- Static Public Member Functions inherited from UT_String
static int dosParse (char *buffer, UT_WorkArgs &args, bool preserve_backslashes)
 
static SYS_FORCE_INLINE uint32 hash (const char *str, uint32 code=0)
 
static int multiMatchCheck (const char *pattern)
 
static int wildcardMatchCheck (const char *pattern)
 
static std::ostream & setFormat (std::ostream &os, const char *fmt)
 
static int compareNumberedString (const char *s1, const char *s2, bool case_sensitive=true, bool allow_negatives=false)
 
static int qsortCmpNumberedString (const char *const *v1, const char *const *v2)
 
static int compareNumberedFilename (const char *s1, const char *s2, bool case_sensitive=false)
 
static int qsortCmpNumberedFilename (const char *const *v1, const char *const *v2)
 
static int compareVersionString (const char *s1, const char *s2)
 
static bool matchProgramName (const char *path, const char *expected, bool normalize_path=false)
 
static int itoa (char *str, int64 i)
 
static int utoa (char *str, uint64 i)
 
static int findLongestCommonPathPrefix (const char *fullpath1, int len1, const char *fullpath2, int len2)
 
static const UT_StringgetEmptyString ()
 
static int countCshModifiers (const char *src)
 

Detailed Description

Creates a shallow wrapper around a string for calling UT_String's many algorithms.

Definition at line 1305 of file UT_String.h.

Constructor & Destructor Documentation

SYS_FORCE_INLINE UT_StringWrap::UT_StringWrap ( const char *  str)
inline

Definition at line 1310 of file UT_String.h.

SYS_FORCE_INLINE UT_StringWrap::~UT_StringWrap ( )
inline

Definition at line 1316 of file UT_String.h.


The documentation for this class was generated from the following file: