JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Steinberg::UString Class Reference

UTF-16 string class without buffer management. More...

#include "ustring.h"

Inheritance diagram for Steinberg::UString:
Steinberg::UStringBuffer< maxSize >

Public Member Functions

 UString (char16 *buffer, int32 size)
 Construct from UTF-16 string, size is in code unit (count of char16)
 
int32 getSize () const
 returns buffer size
 
 operator const char16 * () const
 cast to char16*
 
int32 getLength () const
 Returns length of string (in code unit).
 
UStringassign (const char16 *src, int32 srcSize=-1)
 Copy from UTF-16 buffer (srcSize is in code unit (count of char16)).
 
UStringappend (const char16 *src, int32 srcSize=-1)
 Append UTF-16 buffer (srcSize is in code unit (count of char16)).
 
const UStringcopyTo (char16 *dst, int32 dstSize) const
 Copy to UTF-16 buffer (dstSize is in code unit (count of char16)).
 
UStringfromAscii (const char *src, int32 srcSize=-1)
 Copy from ASCII string (srcSize is in code unit (count of char16)).
 
UStringassign (const char *src, int32 srcSize=-1)
 
const UStringtoAscii (char *dst, int32 dstSize) const
 Copy to ASCII string.
 
bool scanInt (int64 &value) const
 Scan integer from string.
 
bool printInt (int64 value)
 Print integer to string.
 
bool scanFloat (double &value) const
 Scan float from string.
 
bool printFloat (double value, int32 precision=4)
 Print float to string.
 

Protected Attributes

char16 * thisBuffer
 
int32 thisSize
 size in code unit (not in byte!)
 

Detailed Description

UTF-16 string class without buffer management.

Note: that some characters are encoded in 2 UTF16 code units (surrogate pair), this means that getLength returns the number of code unit, not the count of character!

Definition at line 28 of file ustring.h.

Constructor & Destructor Documentation

◆ UString()

Steinberg::UString::UString ( char16 *  buffer,
int32  size 
)

Construct from UTF-16 string, size is in code unit (count of char16)

Definition at line 33 of file ustring.h.

Member Function Documentation

◆ append()

UString & Steinberg::UString::append ( const char16 *  src,
int32  srcSize = -1 
)

Append UTF-16 buffer (srcSize is in code unit (count of char16)).

Definition at line 117 of file ustring.cpp.

◆ assign() [1/2]

UString & Steinberg::UString::assign ( const char src,
int32  srcSize = -1 
)

Definition at line 55 of file ustring.h.

◆ assign() [2/2]

UString & Steinberg::UString::assign ( const char16 *  src,
int32  srcSize = -1 
)

Copy from UTF-16 buffer (srcSize is in code unit (count of char16)).

Definition at line 110 of file ustring.cpp.

◆ copyTo()

const UString & Steinberg::UString::copyTo ( char16 *  dst,
int32  dstSize 
) const

Copy to UTF-16 buffer (dstSize is in code unit (count of char16)).

Definition at line 125 of file ustring.cpp.

◆ fromAscii()

UString & Steinberg::UString::fromAscii ( const char src,
int32  srcSize = -1 
)

Copy from ASCII string (srcSize is in code unit (count of char16)).

Definition at line 132 of file ustring.cpp.

◆ getLength()

int32 Steinberg::UString::getLength ( ) const

Returns length of string (in code unit).

Note this is not the count of character!

Definition at line 104 of file ustring.cpp.

◆ getSize()

int32 Steinberg::UString::getSize ( ) const

returns buffer size

Definition at line 36 of file ustring.h.

◆ operator const char16 *()

Steinberg::UString::operator const char16 * ( ) const

cast to char16*

Definition at line 39 of file ustring.h.

◆ printFloat()

bool Steinberg::UString::printFloat ( double  value,
int32  precision = 4 
)

Print float to string.

Definition at line 173 of file ustring.cpp.

◆ printInt()

bool Steinberg::UString::printInt ( int64  value)

Print integer to string.

Definition at line 238 of file ustring.cpp.

◆ scanFloat()

bool Steinberg::UString::scanFloat ( double value) const

Scan float from string.

Definition at line 146 of file ustring.cpp.

◆ scanInt()

bool Steinberg::UString::scanInt ( int64 &  value) const

Scan integer from string.

Definition at line 211 of file ustring.cpp.

◆ toAscii()

const UString & Steinberg::UString::toAscii ( char dst,
int32  dstSize 
) const

Copy to ASCII string.

Definition at line 139 of file ustring.cpp.

Member Data Documentation

◆ thisBuffer

char16* Steinberg::UString::thisBuffer
protected

Definition at line 73 of file ustring.h.

◆ thisSize

int32 Steinberg::UString::thisSize
protected

size in code unit (not in byte!)

Definition at line 74 of file ustring.h.


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