Main Content

matlab::data::Reference<MATLABString>

C++ class to get reference to element of StringArray

Description

A Reference<MATLABString> object is created when using operator[] into a StringArray or dereferencing a String array iterator.

Class Details

Namespace:

matlab::data

Include:

MATLABStringReferenceExt.hpp

Cast

String()

operator String() const

Returns

matlab::data::String

Element of a MATLABString array converted to String.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

std::runtime_error

Array element does not have a value.

Member Functions

bool

operator bool() const
Description

Check whether string contains a value.

Returns

operator

True, if string contains a value.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

has_value

bool has_value() const
Description

Check whether string contains a value.

Returns

bool

True, if string contains a value.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

Introduced in R2017b