C

QSafeString Class

class SafeRenderer::QSafeString

The QSafeString class contains functions for the string manipulation. More...

Header: #include <QSafeString>
Since: QtSafeRenderer 1.2

This class was introduced in QtSafeRenderer 1.2.

Public Types

enum StringExceptions { TooLong }

Public Functions

QSafeString()
QSafeString(const SafeRenderer::qchar *const strArg)
void append(const SafeRenderer::QSafeString &other)
void append(const SafeRenderer::qchar *const strArg)
void append(const SafeRenderer::qchar *const strArg, const size_t lengthArg)
bool endsWith(const SafeRenderer::qchar chrArg) const
SafeRenderer::quint32 hash() const
const SafeRenderer::qchar *rawCString() const

Detailed Description

The QSafeString class contains functions for the string manipulation.

Member Type Documentation

enum QSafeString::StringExceptions

This enum describes the thrown exceptions of QSafeString class.

ConstantValueDescription
SafeRenderer::QSafeString::TooLong0The string does not fit inside SafeRenderer::Constraints::MAX_LEN_OF_TEXT.

Member Function Documentation

QSafeString::QSafeString()

Constructs empty QSafeString.

QSafeString::QSafeString(const SafeRenderer::qchar *const strArg)

Constructs QSafeString from the null terminated strArg. strArg is copied to QSafeString.

void QSafeString::append(const SafeRenderer::QSafeString &other)

Appends the string other onto the end of this string. If the string does not fit to Constraints::MAX_LEN_OF_TEXT, an exception will be thrown:

ConstantDescription
SafeRenderer::QSafeString::StringExceptions::TooLongThe string does not fit inside SafeRenderer::Constraints::MAX_LEN_OF_TEXT.

void QSafeString::append(const SafeRenderer::qchar *const strArg)

Appends the string strArg onto the end of this string. In case of strArg does not fit to Constraints::MAX_LEN_OF_TEXT, an exception will be thrown:

ConstantDescription
SafeRenderer::QSafeString::StringExceptions::TooLongThe string does not fit inside SafeRenderer::Constraints::MAX_LEN_OF_TEXT.

void QSafeString::append(const SafeRenderer::qchar *const strArg, const size_t lengthArg)

Appends lengthArg amount of characters from the string strArg onto the end of this string. In case of strArg does not fit to Constraints::MAX_LEN_OF_TEXT, an exception will be thrown:

ConstantDescription
SafeRenderer::QSafeString::StringExceptions::TooLongThe string does not fit inside SafeRenderer::Constraints::MAX_LEN_OF_TEXT.

bool QSafeString::endsWith(const SafeRenderer::qchar chrArg) const

Returns true if the string ends with chrArg. Otherwise returns false.

SafeRenderer::quint32 QSafeString::hash() const

Calculates hash value from the string data.

const SafeRenderer::qchar *QSafeString::rawCString() const

Returns pointer to the string array.

Available under certain Qt licenses.
Find out more.