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

#include <UT_WorkBuffer.h>

Classes

class  AutoLock
 

Public Types

typedef char value_type
 

Public Member Functions

SYS_FORCE_INLINE UT_WorkBuffer ()
 
SYS_FORCE_INLINE UT_WorkBuffer (const char *str)
 
SYS_FORCE_INLINE UT_WorkBuffer (const char *data, exint size)
 
SYS_FORCE_INLINE UT_WorkBuffer (const UT_String &str)
 
SYS_FORCE_INLINE UT_WorkBuffer (const UT_StringRef &str)
 
SYS_FORCE_INLINE UT_WorkBuffer (const UT_StringLit &str)
 
SYS_FORCE_INLINE UT_WorkBuffer (const UT_StringView &view)
 
SYS_FORCE_INLINE UT_WorkBuffer (const UT_WorkBuffer &other)
 
SYS_FORCE_INLINE ~UT_WorkBuffer ()
 
SYS_FORCE_INLINE const char * buffer () const
 
SYS_FORCE_INLINE const char * data () const
 
char * lock (exint offset=0, exint reserve_bytes=0)
 
void release (bool recompute_length=false)
 
void releaseSetLength (exint new_length)
 
SYS_FORCE_INLINE exint getAllocatedSize () const
 
int64 getMemoryUsage (bool inclusive) const
 
void reserve (exint bytes=0)
 
SYS_FORCE_INLINE char operator() (exint idx) const
 
SYS_FORCE_INLINE char first () const
 
SYS_FORCE_INLINE char last () const
 
int isNullTerminated () const
 
SYS_FORCE_INLINE UT_WorkBufferoperator= (const UT_WorkBuffer &other)
 
SYS_FORCE_INLINE UT_WorkBufferoperator= (const char *str)
 
SYS_FORCE_INLINE UT_WorkBufferoperator= (const std::string &str)
 
SYS_FORCE_INLINE void strcpy (const char *src)
 
SYS_FORCE_INLINE void strcpy (const UT_String &src)
 
SYS_FORCE_INLINE void strcpy (const UT_StringRef &src)
 
SYS_FORCE_INLINE void strcpy (const UT_WorkBuffer &src)
 
SYS_FORCE_INLINE void strcpy (const UT_StringView &src)
 
SYS_FORCE_INLINE void strncpy (const char *src, exint maxlen)
 
SYS_FORCE_INLINE exint strlen () const
 
SYS_FORCE_INLINE exint length () const
 
SYS_FORCE_INLINE void strcat (const char *src)
 
void protectedStrcat (const char *str, bool force_quote=false)
 
void fullyProtectedStrcat (const char *str, bool force_quote=false)
 
void fullyProtectedBinaryStrcat (const char *str, exint size, bool force_quote=false)
 
SYS_FORCE_INLINE void strncat (const char *src, exint len)
 
void strcatFirstWord (const char *src)
 
SYS_FORCE_INLINE int strcmp (const char *src) const
 
SYS_FORCE_INLINE int strncmp (const char *src, exint n) const
 
SYS_FORCE_INLINE char * strdup () const
 
SYS_FORCE_INLINE void clear ()
 
SYS_FORCE_INLINE bool isEmpty () const
 
SYS_FORCE_INLINE bool isstring () const
 
SYS_FORCE_INLINE void write (exint offset, char c)
 
void write (exint offset, const char *src)
 
void write (exint offset, const UT_StringHolder &src)
 
bool readFile (const char *filename)
 
bool getline (std::istream &is)
 
bool getline (FILE *fp)
 
bool cmdGetLine (std::istream &is, UT_WorkArgs &args, int &line_num, const char *comment_chars="#", const char *separators=" \t\n\r")
 
bool cmdGetLine (UT_IStream &is, UT_WorkArgs &args, int &line_num, const char *comment_chars="#", const char *separators=" \t\n\r")
 
bool cmdGetLine (FILE *fp, UT_WorkArgs &args, int &line_num, const char *comment_chars="#", const char *separators=" \t\n\r")
 
int sprintf (const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
 
int int appendSprintf (const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
 
int int int vsprintf (const char *fmt, va_list ap)
 
template<typename... Args>
size_t format (const char *fmt, const Args &...args)
 
size_t appendFormatByArray (const char *fmt, const UT_Array< UT::Format::ArgValue > &args, bool report_errors=true)
 Like appendFormat() except it that uses an array of arguments. More...
 
SYS_FORCE_INLINE void append (char character)
 
void printMemory (int64 mem)
 
void appendPrintMemory (int64 mem)
 
void append (exint n, char character)
 
void append (utf32 cp)
 Append a single Unicode code point, converted to UTF8. More...
 
void append (const char *data, exint size)
 
SYS_FORCE_INLINE void append (const char *str)
 
SYS_FORCE_INLINE void append (const UT_String &str)
 
SYS_FORCE_INLINE void append (const UT_StringRef &str)
 
SYS_FORCE_INLINE void append (const UT_StringLit &str)
 
void append (const UT_StringArray &strs, const UT_StringRef &sep)
 
SYS_FORCE_INLINE void append (const UT_WorkBuffer &wb)
 
SYS_FORCE_INLINE void append (const UT_StringView &view)
 
void append (const UT_Digits &)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const char *str)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const std::string &str)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const UT_WorkBuffer &wb)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const UT_String &str)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const UT_StringRef &str)
 
SYS_FORCE_INLINE UT_WorkBufferoperator+= (const UT_Digits &digits)
 
void prepend (char character)
 
void prepend (const char *data, exint size)
 
SYS_FORCE_INLINE void prepend (const char *str)
 
SYS_FORCE_INLINE void prepend (const UT_String &str)
 
SYS_FORCE_INLINE void prepend (const UT_StringRef &str)
 
void insert (exint pos, const char *str, exint slen)
 
void erase (exint pos, exint len)
 Erase len characters from location pos in the string. More...
 
void rewind ()
 
SYS_FORCE_INLINE void backup (exint by_length)
 Rewind by the given length. More...
 
SYS_FORCE_INLINE void truncate (exint new_length)
 
void backupTo (char c)
 
void advance (exint by_length)
 
SYS_FORCE_INLINE const char * findChar (char c, int occurance_number=1) const
 
const char * lastChar (char c, int occurance_number=1) const
 
const char * findCharFrom (char c, exint position, int occurance_number=1) const
 
void adoptFromMalloc (char *data, exint length)
 
void adoptFromCharArray (UT_Array< char > &data)
 
exint count (const char *needle) const
 Count the occurrences of the text in the current string. More...
 
bool getNextToken (const char *(&string), const UT_String separators=" \t\n")
 
void copyIntoString (UT_String &str) const
 
void copyIntoString (char *str, exint max_length) const
 
void stealIntoString (UT_String &str)
 
void stealIntoStringHolder (UT_StringHolder &str)
 
std::string toStdString () const
 
bool stripComments (char comment_char= '#')
 
int strip (const char *chars)
 
void removeTrailingSpaceLines ()
 Remove trailing whitespace lines. More...
 
bool removeTrailingSpace ()
 Remove trailing whitespace, return true if whitespace was removed. More...
 
bool removeLeadingSpace ()
 Remove leading white space, return true if whitespace was removed. More...
 
bool removeTrailingDigits ()
 Remove trailing digits, return true if some were removed. More...
 
void lower ()
 Convert string to lower case. More...
 
void upper ()
 Convert string to upper case. More...
 
void makeIndentString (exint indent, exint tabstop=8)
 Create a string of tabs & spaces which represents the given indent. More...
 
void eraseHead (exint n)
 Remove the first n characters. More...
 
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...
 
bool subPatterns (const char *to_pattern, const char *from_name, const char *from_pattern)
 
void setFromUTF16 (const utf16 *str)
 UTF-16 / UTF-8 conversions. More...
 
void setAsUTF16 (const utf8 *str)
 
SYS_FORCE_INLINE const utf16castToUTF16 () const
 Once set as UTF16-LE, get it back as such a pointer. More...
 
utf16lockUTF16 (exint offset=0, exint len=0)
 Lock buffer for len utf-16 characters. More...
 
void swap (UT_WorkBuffer &other)
 
SYS_FORCE_INLINE const char * begin () const
 Iterator compatibility. More...
 
SYS_FORCE_INLINE const char * end () const
 
SYS_FORCE_INLINE bool operator== (const char *str) const
 
SYS_FORCE_INLINE bool operator== (const UT_String &str) const
 
SYS_FORCE_INLINE bool operator== (const UT_StringRef &str) const
 
SYS_FORCE_INLINE bool operator== (const UT_WorkBuffer &buf) const
 
SYS_FORCE_INLINE bool operator!= (const char *str) const
 
SYS_FORCE_INLINE bool operator!= (const UT_String &str) const
 
SYS_FORCE_INLINE bool operator!= (const UT_StringRef &str) const
 
SYS_FORCE_INLINE bool operator!= (const UT_WorkBuffer &buf) const
 
void itoa (int64 i)
 
void utoa (uint64 i)
 
template<typename... Args>
size_t appendFormat (const char *fmt, const Args &...args)
 
size_t appendFormat (const char *fmt, std::initializer_list< UT::Format::ArgValue > args)
 

Static Public Member Functions

static SYS_FORCE_INLINE
UT_WorkBuffer 
widen (const utf8 *str)
 
static SYS_FORCE_INLINE
UT_WorkBuffer 
narrow (const utf16 *str)
 

Friends

UT_API std::ostream & operator<< (std::ostream &os, const UT_WorkBuffer &buffer)
 

Detailed Description

Member Typedef Documentation

Definition at line 77 of file UT_WorkBuffer.h.

Constructor & Destructor Documentation

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( )
inline

Definition at line 80 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const char *  str)
inlineexplicit

Definition at line 86 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const char *  data,
exint  size 
)
inlineexplicit

Definition at line 93 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const UT_String str)
inlineexplicit

Definition at line 100 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const UT_StringRef str)
inlineexplicit

Definition at line 107 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const UT_StringLit str)
inlineexplicit

Definition at line 114 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const UT_StringView view)
inlineexplicit

Definition at line 121 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::UT_WorkBuffer ( const UT_WorkBuffer other)
inline

Definition at line 128 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer::~UT_WorkBuffer ( )
inline

Definition at line 135 of file UT_WorkBuffer.h.

Member Function Documentation

void UT_WorkBuffer::adoptFromCharArray ( UT_Array< char > &  data)
void UT_WorkBuffer::adoptFromMalloc ( char *  data,
exint  length 
)

Adopt a string from an outside source. The passed string is now owned by the workbuffer.

void UT_WorkBuffer::advance ( exint  by_length)
inline

Definition at line 839 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( char  character)
inline
Examples:
FS/FS_HomeHelper.C, and SIM/GAS_NetVDBSliceExchange.C.

Definition at line 618 of file UT_WorkBuffer.h.

void UT_WorkBuffer::append ( exint  n,
char  character 
)
inline

Definition at line 631 of file UT_WorkBuffer.h.

void UT_WorkBuffer::append ( utf32  cp)
inline

Append a single Unicode code point, converted to UTF8.

Definition at line 642 of file UT_WorkBuffer.h.

void UT_WorkBuffer::append ( const char *  data,
exint  size 
)
inline

Definition at line 657 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( const char *  str)
inline

Definition at line 669 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( const UT_String str)
inline

Definition at line 676 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( const UT_StringRef str)
inline

Definition at line 683 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( const UT_StringLit str)
inline

Definition at line 690 of file UT_WorkBuffer.h.

void UT_WorkBuffer::append ( const UT_StringArray strs,
const UT_StringRef sep 
)
SYS_FORCE_INLINE void UT_WorkBuffer::append ( const UT_WorkBuffer wb)
inline

Definition at line 698 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::append ( const UT_StringView view)
inline

Definition at line 704 of file UT_WorkBuffer.h.

void UT_WorkBuffer::append ( const UT_Digits )
template<typename... Args>
size_t UT_WorkBuffer::appendFormat ( const char *  fmt,
const Args &...  args 
)
inline

Append to the work buffer using the same formatting as UTformat. Returns the size of the appended portion, in bytes. If fmt is nullptr will space-separate the arguments like python print.

Definition at line 604 of file UT_WorkBuffer.h.

size_t UT_WorkBuffer::appendFormat ( const char *  fmt,
std::initializer_list< UT::Format::ArgValue args 
)

Append to the work buffer using the same formatting as UTformat. Returns the size of the appended portion, in bytes. If fmt is nullptr will space-separate the arguments like python print.

size_t UT_WorkBuffer::appendFormatByArray ( const char *  fmt,
const UT_Array< UT::Format::ArgValue > &  args,
bool  report_errors = true 
)

Like appendFormat() except it that uses an array of arguments.

void UT_WorkBuffer::appendPrintMemory ( int64  mem)
int int UT_WorkBuffer::appendSprintf ( const char *  fmt,
  ... 
)
SYS_FORCE_INLINE void UT_WorkBuffer::backup ( exint  by_length)
inline

Rewind by the given length.

Definition at line 805 of file UT_WorkBuffer.h.

void UT_WorkBuffer::backupTo ( char  c)
inline

Definition at line 830 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE const char* UT_WorkBuffer::begin ( void  ) const
inline

Iterator compatibility.

Definition at line 1073 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE const utf16* UT_WorkBuffer::castToUTF16 ( ) const
inline

Once set as UTF16-LE, get it back as such a pointer.

Definition at line 1027 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::clear ( void  )
inline
Examples:
SIM/GAS_NetVDBSliceExchange.C.

Definition at line 496 of file UT_WorkBuffer.h.

bool UT_WorkBuffer::cmdGetLine ( std::istream &  is,
UT_WorkArgs args,
int line_num,
const char *  comment_chars = "#",
const char *  separators = " \t\n\r" 
)
bool UT_WorkBuffer::cmdGetLine ( UT_IStream is,
UT_WorkArgs args,
int line_num,
const char *  comment_chars = "#",
const char *  separators = " \t\n\r" 
)
bool UT_WorkBuffer::cmdGetLine ( FILE *  fp,
UT_WorkArgs args,
int line_num,
const char *  comment_chars = "#",
const char *  separators = " \t\n\r" 
)
void UT_WorkBuffer::copyIntoString ( UT_String str) const
Examples:
FS/FS_HomeHelper.C.
void UT_WorkBuffer::copyIntoString ( char *  str,
exint  max_length 
) const
exint UT_WorkBuffer::count ( const char *  needle) const

Count the occurrences of the text in the current string.

SYS_FORCE_INLINE const char* UT_WorkBuffer::data ( ) const
inline

Alias for the common string access across all string types (including standard library)

Definition at line 173 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE const char* UT_WorkBuffer::end ( void  ) const
inline

Definition at line 1075 of file UT_WorkBuffer.h.

void UT_WorkBuffer::erase ( exint  pos,
exint  len 
)

Erase len characters from location pos in the string.

void UT_WorkBuffer::eraseHead ( exint  n)
inline

Remove the first n characters.

Definition at line 973 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE const char* UT_WorkBuffer::findChar ( char  c,
int  occurance_number = 1 
) const
inline

Definition at line 853 of file UT_WorkBuffer.h.

const char* UT_WorkBuffer::findCharFrom ( char  c,
exint  position,
int  occurance_number = 1 
) const
inline

Definition at line 879 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE char UT_WorkBuffer::first ( ) const
inline

Definition at line 270 of file UT_WorkBuffer.h.

template<typename... Args>
size_t UT_WorkBuffer::format ( const char *  fmt,
const Args &...  args 
)
inline

Replace the contents of the work buffer using the same formatting as UTformat. Returns the resulting length in bytes. If fmt is nullptr will space-separate the arguments like python print.

Definition at line 594 of file UT_WorkBuffer.h.

void UT_WorkBuffer::fullyProtectedBinaryStrcat ( const char *  str,
exint  size,
bool  force_quote = false 
)
void UT_WorkBuffer::fullyProtectedStrcat ( const char *  str,
bool  force_quote = false 
)
SYS_FORCE_INLINE exint UT_WorkBuffer::getAllocatedSize ( ) const
inline

Definition at line 201 of file UT_WorkBuffer.h.

bool UT_WorkBuffer::getline ( std::istream &  is)
bool UT_WorkBuffer::getline ( FILE *  fp)
int64 UT_WorkBuffer::getMemoryUsage ( bool  inclusive) const
bool UT_WorkBuffer::getNextToken ( const char *&  string,
const UT_String  separators = " \t\n" 
)
void UT_WorkBuffer::insert ( exint  pos,
const char *  str,
exint  slen 
)

Insert slen characters from str, at location pos. If pos exceeds the current length, the position is truncated and to an append.

SYS_FORCE_INLINE bool UT_WorkBuffer::isEmpty ( ) const
inline

Definition at line 504 of file UT_WorkBuffer.h.

int UT_WorkBuffer::isNullTerminated ( ) const
SYS_FORCE_INLINE bool UT_WorkBuffer::isstring ( ) const
inline
Examples:
SIM/GAS_NetVDBSliceExchange.C.

Definition at line 509 of file UT_WorkBuffer.h.

void UT_WorkBuffer::itoa ( int64  i)

Fast integer to string conversion.

SYS_FORCE_INLINE char UT_WorkBuffer::last ( ) const
inline

Definition at line 277 of file UT_WorkBuffer.h.

const char* UT_WorkBuffer::lastChar ( char  c,
int  occurance_number = 1 
) const
inline

Definition at line 858 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE exint UT_WorkBuffer::length ( void  ) const
inline
Examples:
SIM/GAS_NetVDBSliceExchange.C.

Definition at line 429 of file UT_WorkBuffer.h.

char* UT_WorkBuffer::lock ( exint  offset = 0,
exint  reserve_bytes = 0 
)
utf16* UT_WorkBuffer::lockUTF16 ( exint  offset = 0,
exint  len = 0 
)
inline

Lock buffer for len utf-16 characters.

Definition at line 1030 of file UT_WorkBuffer.h.

void UT_WorkBuffer::lower ( )

Convert string to lower case.

Examples:
packedshareddata/GU_PackedSharedData.C.
void UT_WorkBuffer::makeIndentString ( exint  indent,
exint  tabstop = 8 
)

Create a string of tabs & spaces which represents the given indent.

static SYS_FORCE_INLINE UT_WorkBuffer UT_WorkBuffer::narrow ( const utf16 str)
inlinestatic

Create a work buffer to contain the UTF-8 representation of the incoming UTF-16 string. The UTF-16 string is assumed to be little-endian, unless prefixed with BOM that indicates endianness. The incoming string should be zero-word terminated.

Definition at line 160 of file UT_WorkBuffer.h.

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

Comparison operator. Null strings are considered as empty strings.

Definition at line 340 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator!= ( const UT_String str) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 345 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator!= ( const UT_StringRef str) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 350 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator!= ( const UT_WorkBuffer buf) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 355 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE char UT_WorkBuffer::operator() ( exint  idx) const
inline

Definition at line 260 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const char *  str)
inline

Definition at line 714 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const std::string str)
inline

Definition at line 721 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const UT_WorkBuffer wb)
inline

Definition at line 728 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const UT_String str)
inline

Definition at line 735 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const UT_StringRef str)
inline

Definition at line 742 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator+= ( const UT_Digits digits)
inline

Definition at line 749 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator= ( const UT_WorkBuffer other)
inline

Definition at line 287 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator= ( const char *  str)
inline

Definition at line 293 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE UT_WorkBuffer& UT_WorkBuffer::operator= ( const std::string str)
inline

Definition at line 300 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator== ( const char *  str) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 310 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator== ( const UT_String str) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 317 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator== ( const UT_StringRef str) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 324 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE bool UT_WorkBuffer::operator== ( const UT_WorkBuffer buf) const
inline

Comparison operator. Null strings are considered as empty strings.

Definition at line 331 of file UT_WorkBuffer.h.

void UT_WorkBuffer::prepend ( char  character)
inline

Definition at line 755 of file UT_WorkBuffer.h.

void UT_WorkBuffer::prepend ( const char *  data,
exint  size 
)
inline

Definition at line 764 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::prepend ( const char *  str)
inline

Definition at line 775 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::prepend ( const UT_String str)
inline

Definition at line 782 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::prepend ( const UT_StringRef str)
inline

Definition at line 788 of file UT_WorkBuffer.h.

void UT_WorkBuffer::printMemory ( int64  mem)
inline

Definition at line 628 of file UT_WorkBuffer.h.

void UT_WorkBuffer::protectedStrcat ( const char *  str,
bool  force_quote = false 
)
bool UT_WorkBuffer::readFile ( const char *  filename)

Load an entire file into the buffer. Returns false if there was an error reading the file

void UT_WorkBuffer::release ( bool  recompute_length = false)
void UT_WorkBuffer::releaseSetLength ( exint  new_length)
bool UT_WorkBuffer::removeLeadingSpace ( )

Remove leading white space, return true if whitespace was removed.

bool UT_WorkBuffer::removeTrailingDigits ( )

Remove trailing digits, return true if some were removed.

bool UT_WorkBuffer::removeTrailingSpace ( )

Remove trailing whitespace, return true if whitespace was removed.

void UT_WorkBuffer::removeTrailingSpaceLines ( )

Remove trailing whitespace lines.

void UT_WorkBuffer::reserve ( exint  bytes = 0)
void UT_WorkBuffer::rewind ( )
inline

Definition at line 801 of file UT_WorkBuffer.h.

void UT_WorkBuffer::setAsUTF16 ( const utf8 str)

Set the work buffer to contain a UTF-16LE (little endian) representation of the incoming UTF-8 string. The work buffer will be zero-word terminated.

void UT_WorkBuffer::setFromUTF16 ( const utf16 str)

UTF-16 / UTF-8 conversions.

Set the work buffer to contain the UTF-8 representation of the incoming UTF-16 string. The UTF-16 string is assumed to be little-endian, unless prefixed with BOM that indicates endianness. The incoming string should be zero-word terminated.

int UT_WorkBuffer::sprintf ( const char *  fmt,
  ... 
)
void UT_WorkBuffer::stealIntoString ( UT_String str)
void UT_WorkBuffer::stealIntoStringHolder ( UT_StringHolder str)
SYS_FORCE_INLINE void UT_WorkBuffer::strcat ( const char *  src)
inline

Definition at line 435 of file UT_WorkBuffer.h.

void UT_WorkBuffer::strcatFirstWord ( const char *  src)
SYS_FORCE_INLINE int UT_WorkBuffer::strcmp ( const char *  src) const
inline
Examples:
SIM/GAS_NetVDBSliceExchange.C.

Definition at line 474 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strcpy ( const char *  src)
inline
SYS_FORCE_INLINE void UT_WorkBuffer::strcpy ( const UT_String src)
inline

Definition at line 383 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strcpy ( const UT_StringRef src)
inline

Definition at line 389 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strcpy ( const UT_WorkBuffer src)
inline

Definition at line 395 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strcpy ( const UT_StringView src)
inline

Definition at line 401 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE char* UT_WorkBuffer::strdup ( ) const
inline

Definition at line 488 of file UT_WorkBuffer.h.

int UT_WorkBuffer::strip ( const char *  chars)

Strips out all characters found in 'chars'. The string length will be reduced by the number of characters removed. The number of characters removed is returned.

bool UT_WorkBuffer::stripComments ( char  comment_char = '#')
SYS_FORCE_INLINE exint UT_WorkBuffer::strlen ( ) const
inline

Definition at line 422 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strncat ( const char *  src,
exint  len 
)
inline

Append a string of a given maximum length to the current string. Unlike the POSIX's strncat(3), we ignore any NUL bytes in the current string and blindly append at the end of the work buffer.

Definition at line 461 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE int UT_WorkBuffer::strncmp ( const char *  src,
exint  n 
) const
inline

Definition at line 481 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::strncpy ( const char *  src,
exint  maxlen 
)
inline

Definition at line 409 of file UT_WorkBuffer.h.

bool UT_WorkBuffer::subPatterns ( const char *  to_pattern,
const char *  from_name,
const char *  from_pattern 
)

Given from_name which is assumed to fit from_pattern, any assigned wildcards are subsitituted in to_pattern, writing the result to this. The wildcards may also be indexed. For example:

to_pattern = b* from_name = apple from_pattern = a*le —> this = bpp

to_pattern = *(1)_to_*(0) from_name = a_to_b from_pattern = *_to_* —> this = b_to_a

int UT_WorkBuffer::substitute ( const char *  find,
const char *  replacement,
int  count = -1 
)

Replaces up to 'count' occurrences of 'find' with 'replacement', and returns the number of substitutions that occurred. If 'count' <= 0, all occurrences will be replaced.

int UT_WorkBuffer::substitute ( const char *  find,
const char *  replacement,
bool  all 
)
inline

Convenience version of substitute() for all or single occurrence.

Definition at line 993 of file UT_WorkBuffer.h.

void UT_WorkBuffer::swap ( UT_WorkBuffer other)
inline

Definition at line 1035 of file UT_WorkBuffer.h.

std::string UT_WorkBuffer::toStdString ( ) const
inline

Definition at line 937 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::truncate ( exint  new_length)
inline

Truncate the buffer to the specified length. Truncating to 0 is identical to clear().

Definition at line 818 of file UT_WorkBuffer.h.

void UT_WorkBuffer::upper ( )

Convert string to upper case.

void UT_WorkBuffer::utoa ( uint64  i)

Fast integer to string conversion.

int int int UT_WorkBuffer::vsprintf ( const char *  fmt,
va_list  ap 
)
static SYS_FORCE_INLINE UT_WorkBuffer UT_WorkBuffer::widen ( const utf8 str)
inlinestatic

Create a work buffer to contain a UTF-16LE (little endian) representation of the incoming UTF-8 string. The work buffer will be zero-word terminated.

Definition at line 149 of file UT_WorkBuffer.h.

SYS_FORCE_INLINE void UT_WorkBuffer::write ( exint  offset,
char  c 
)
inline

Definition at line 518 of file UT_WorkBuffer.h.

void UT_WorkBuffer::write ( exint  offset,
const char *  src 
)
inline

Definition at line 536 of file UT_WorkBuffer.h.

void UT_WorkBuffer::write ( exint  offset,
const UT_StringHolder src 
)
inline

Definition at line 546 of file UT_WorkBuffer.h.

Friends And Related Function Documentation

UT_API std::ostream& operator<< ( std::ostream &  os,
const UT_WorkBuffer buffer 
)
friend

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