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

#include <UT_DeepString.h>

+ Inheritance diagram for UT_DeepString:

Public Member Functions

 UT_DeepString (const char *str=0)
 
 UT_DeepString (const std::string &str)
 
 UT_DeepString (const UT_String &str)
 
 UT_DeepString (const UT_DeepString &str)
 
 ~UT_DeepString ()
 
UT_DeepStringoperator= (const UT_DeepString &str)
 
UT_DeepStringoperator= (const UT_String &str)
 
UT_DeepStringoperator= (const char *str)
 
bool operator== (const char *str) const
 
bool operator== (const UT_String &str) const
 
bool operator!= (const char *str) const
 
bool operator!= (const UT_String &str) const
 
bool operator< (const char *str) const
 
bool operator< (const UT_String &str) const
 
bool operator<= (const char *str) const
 
bool operator<= (const UT_String &str) const
 
bool operator> (const char *str) const
 
bool operator> (const UT_String &str) const
 
bool operator>= (const char *str) const
 
bool operator>= (const UT_String &str) const
 
- 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, bool deep_copy, int len=-1)
 Construct UT_String from a C string, using shallow semantics. More...
 
 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 (UT_StringHolder &&str)
 Construct UT_String from a UT_StringHolder rvalue with 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 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= (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 * ()
 
 operator UT_StringView () const
 
const char * c_str () const
 
const char * buffer () const
 
const char * data () 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 () const
 Return length of string. More...
 
int64 getMemoryUsage (bool inclusive=true) const
 Return memory usage in bytes. 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 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, bool all=true)
 
int changeString (const char *from, const char *to, bool fullword)
 
int changeQuotedWord (const char *from, const char *to, int quote= '`', bool all=true)
 
int findLongestCommonSuffix (const char *with) const
 
int substr (UT_String &buf, int index, int len=0) const
 
bool isFloat (bool skip_spaces=false, bool loose=false, bool allow_underscore=false) const
 Determine if string can be seen as a single floating point number. More...
 
bool isInteger (bool skip_spaces=false) const
 Determine if string can be seen as a single integer number. More...
 
void toUpper ()
 
void toLower ()
 
const char * fileName () const
 
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 leave_single_space_between_words=false)
 
int trimBoundingSpace ()
 
int strip (const char *chars)
 
void protectString (bool protect_empty=false)
 
void protectPreQuotePythonStringLiteral (char delimiter='\'')
 protectPreQuotePythonStringLiteral() will modify the existing string More...
 
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 parse (char *argv[], int max_args, const char *quotes="\"'", bool keep_quotes=false)
 
int parse (UT_WorkArgs &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int parse (UT_StringArray &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int parseInPlace (char *argv[], int max_args, const char *quotes="\"'", bool keep_quotes=false)
 
int parseInPlace (UT_WorkArgs &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int parseInPlace (UT_StringArray &argv, int start_arg=0, const char *quotes="\"'", bool keep_quotes=false)
 
int tokenize (char *argv[], int max_args, char separator)
 
int tokenizeInPlace (char *argv[], int max_args, char separator)
 
int tokenize (UT_WorkArgs &argv, char separator)
 
int tokenizeInPlace (UT_WorkArgs &argv, char separator)
 
int tokenize (char *argv[], int max_args, const char *separators=" \t\n")
 
int tokenizeInPlace (char *argv[], int max_args, 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
 
bool match (const char *pattern, bool case_sensitive=true) const
 
bool matchFile (const char *pattern) const
 
bool matchPath (const char *pattern, bool case_sensitive=true, bool *excludes_branch=nullptr) const
 
bool multiMatch (const char *pattern, bool case_sensitive, char separator) const
 
bool multiMatch (const char *pattern, bool case_sensitive=true, const char *separators=", ", bool *explicitly_excluded=0, int *match_index=0, ut_PatternRecord *pattern_record=NULL) const
 
bool multiMatch (const UT_StringMMPattern &pattern, bool *explicitly_excluded=0, int *match_index=0, ut_PatternRecord *pattern_record=NULL) const
 
bool multiMatchRecord (const char *pattern, int maxpatterns, char *singles, int &nsingles, char **words, int &nwords, bool case_sensitive=true, const char *separators=", ") const
 
bool multiMatchRecord (const UT_StringMMPattern &pattern, int maxpatterns, char *singles, int &nsingles, char **words, int &nwords) const
 
bool multiMatchRecord (const char *pattern, UT_StringHolder &singles, UT_StringArray &words, bool case_sensitive=true, 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 UT_StringView &prefix, bool case_sensitive=true) const
 
bool endsWith (const UT_StringView &suffix, bool case_sensitive=true) 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 () const
 
void incrementNumberedName (bool preserve_padding=false)
 
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, int count=-1)
 
int substitute (const char *find, const char *replacement, bool all)
 Convenience version of substitute() for all or single occurrence. More...
 
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 itoaPretty (int64 val)
 
void timeDeltaToPrettyString (double time_ms)
 
void timeDeltaToPrettyStringMS (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...
 
int expandArrays (UT_StringArray &tokens, UT_StringArray &names)
 
 UT_String (UT_String &&str) 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 (int c)
 
const char * findChar (int c) const
 
char * findChar (const char *str)
 
const char * findChar (const char *str) const
 
char * lastChar (int c)
 
const char * lastChar (int c) const
 
char * fileExtension ()
 
const char * fileExtension () const
 
int cshParse (char *argv[], int max_args, 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 max_args, bool preserve_backslashes=false)
 

Additional Inherited Members

- Public Types inherited from UT_String
enum  UT_AlwaysDeepType { ALWAYS_DEEP }
 
- Static Public Member Functions inherited from UT_String
static void protectString (std::ostream &os, char c)
 
static SYS_FORCE_INLINE uint32 hash (const char *str, uint32 code=0)
 
static bool multiMatchCheck (const char *pattern)
 
static bool 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 compareNumberedStringWithExceptions (const char *s1, const char *s2, bool case_sensitive=false, bool allow_negatives=false, const char *sorted_first=nullptr, const char *sorted_last=nullptr)
 
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)
 
static int dosParse (char *buffer, UT_WorkArgs &args, bool preserve_backslashes)
 

Detailed Description

Definition at line 29 of file UT_DeepString.h.

Constructor & Destructor Documentation

UT_DeepString::UT_DeepString ( const char *  str = 0)
inline

Definition at line 32 of file UT_DeepString.h.

UT_DeepString::UT_DeepString ( const std::string str)
inline

Definition at line 36 of file UT_DeepString.h.

UT_DeepString::UT_DeepString ( const UT_String str)
inline

Definition at line 40 of file UT_DeepString.h.

UT_DeepString::UT_DeepString ( const UT_DeepString str)
inline

Definition at line 46 of file UT_DeepString.h.

UT_DeepString::~UT_DeepString ( )
inline

Definition at line 50 of file UT_DeepString.h.

Member Function Documentation

bool UT_DeepString::operator!= ( const char *  str) const
inline

Definition at line 76 of file UT_DeepString.h.

bool UT_DeepString::operator!= ( const UT_String str) const
inline

Definition at line 78 of file UT_DeepString.h.

bool UT_DeepString::operator< ( const char *  str) const
inline

Definition at line 81 of file UT_DeepString.h.

bool UT_DeepString::operator< ( const UT_String str) const
inline

Definition at line 83 of file UT_DeepString.h.

bool UT_DeepString::operator<= ( const char *  str) const
inline

Definition at line 86 of file UT_DeepString.h.

bool UT_DeepString::operator<= ( const UT_String str) const
inline

Definition at line 88 of file UT_DeepString.h.

UT_DeepString& UT_DeepString::operator= ( const UT_DeepString str)
inline

Definition at line 53 of file UT_DeepString.h.

UT_DeepString& UT_DeepString::operator= ( const UT_String str)
inline

Definition at line 59 of file UT_DeepString.h.

UT_DeepString& UT_DeepString::operator= ( const char *  str)
inline

Definition at line 65 of file UT_DeepString.h.

bool UT_DeepString::operator== ( const char *  str) const
inline

Definition at line 71 of file UT_DeepString.h.

bool UT_DeepString::operator== ( const UT_String str) const
inline

Definition at line 73 of file UT_DeepString.h.

bool UT_DeepString::operator> ( const char *  str) const
inline

Definition at line 91 of file UT_DeepString.h.

bool UT_DeepString::operator> ( const UT_String str) const
inline

Definition at line 93 of file UT_DeepString.h.

bool UT_DeepString::operator>= ( const char *  str) const
inline

Definition at line 96 of file UT_DeepString.h.

bool UT_DeepString::operator>= ( const UT_String str) const
inline

Definition at line 98 of file UT_DeepString.h.


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