ASPiK SDK
VSTGUI::UTF8StringView Class Reference

a view on a null terminated UTF-8 String More...

#include <cstring.h>

Public Member Functions

 UTF8StringView (const UTF8StringPtr string)
 
 UTF8StringView (const UTF8String &string)
 
 UTF8StringView (const std::string &string)
 
 UTF8StringView (const UTF8StringView &other) noexcept
 
UTF8StringViewoperator= (const UTF8StringView &other) noexcept
 
 UTF8StringView (UTF8StringView &&other) noexcept=default
 
UTF8StringViewoperator= (UTF8StringView &&other)=default
 
size_t calculateByteCount () const
 
size_t calculateCharacterCount () const
 
bool contains (const UTF8StringPtr subString, bool ignoreCase=false) const
 
bool startsWith (const UTF8StringView &startString) const
 
bool endsWith (const UTF8StringView &endString) const
 
double toDouble (uint32_t precision=8) const
 
float toFloat (uint32_t precision=8) const
 
int64_t toInteger () const
 
template<typename T >
Optional< T > toNumber () const
 
bool operator== (const UTF8StringPtr otherString) const
 
bool operator!= (const UTF8StringPtr otherString) const
 
bool operator== (UTF8StringView otherString) const
 
 operator const UTF8StringPtr () const
 

Detailed Description

a view on a null terminated UTF-8 String

It does not copy the string. It's allowed to put null pointers into it. A null pointer is treaded different than an empty string as they are not equal and the byte count of a null pointer is zero while the empty string has a byte count of one.

Member Function Documentation

◆ calculateByteCount()

size_t VSTGUI::UTF8StringView::calculateByteCount ( ) const
inline

calculates the bytes used by this string, including null-character

◆ calculateCharacterCount()

size_t VSTGUI::UTF8StringView::calculateCharacterCount ( ) const
inline

calculates the number of UTF-8 characters in the string

◆ contains()

bool VSTGUI::UTF8StringView::contains ( const UTF8StringPtr  subString,
bool  ignoreCase = false 
) const
inline

checks this string if it contains a subString

◆ endsWith()

bool VSTGUI::UTF8StringView::endsWith ( const UTF8StringView endString) const
inline

checks this string if it ends with endString

◆ startsWith()

bool VSTGUI::UTF8StringView::startsWith ( const UTF8StringView startString) const
inline

checks this string if it starts with startString

◆ toDouble()

double VSTGUI::UTF8StringView::toDouble ( uint32_t  precision = 8) const
inline

converts the string to a double

◆ toFloat()

float VSTGUI::UTF8StringView::toFloat ( uint32_t  precision = 8) const
inline

converts the string to a float

◆ toInteger()

int64_t VSTGUI::UTF8StringView::toInteger ( ) const
inline

converts the string to an integer


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