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 { InvalidData, IndexOutOfBounds, TooLong }

Public Functions

QSafeString()
QSafeString(const SafeRenderer::qchar *const str)
void append(const SafeRenderer::QSafeString &other)
void append(const SafeRenderer::qchar *const str)
void append(const SafeRenderer::qchar *const str, const size_t lengthArg)
const SafeRenderer::qchar *data() const
bool endsWith(const SafeRenderer::qchar chrArg) const
SafeRenderer::quint32 hash() 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::InvalidData0The data is invalid.
SafeRenderer::QSafeString::IndexOutOfBounds1The index of the string is out of bounds.
SafeRenderer::QSafeString::TooLong2The 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 str)

Constructs QSafeString from the null terminated str. str 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 str)

Appends the string str onto the end of this string. In case of str 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 str, const size_t lengthArg)

Appends lengthArg amount of characters from the string str onto the end of this string. In case of str 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.

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

Returns pointer to the string array.

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.

Available under certain Qt licenses.
Find out more.