StringImpl

The underlying implementation of a numem string.

Constructors

this
this(U rhs)

Creates a string from a string from any other UTF encoding.

this
this(Args args)
Undocumented in source.
this
this(inout(SelfType) rhs)

Copy-constructor

this
this(uint size)

Constructs a string with the given size. The contents of the string will be zero-initialized.

Destructor

~this
~this()
Undocumented in source.

Alias This

value

Members

Aliases

CharType
alias CharType = T

The type of character the string contains.

toCString
alias toCString = ptr
Undocumented in source.
toDString
alias toDString = value
Undocumented in source.

Functions

clear
void clear()

Clears the string, equivalent to resizing it to 0.

flipEndian
auto ref flipEndian()

Flips the endianness of the string's contents.

opAssign
void opAssign(U other)

Sets the value of the string.

opBinary
auto opBinary(R rhs)

Makes a nstring appended to this string.

opBinaryRight
auto opBinaryRight(R lhs)

Makes a nstring prepended to this string.

opOpAssign
void opOpAssign(inout(U) value)

Appends a character to this string.

opOpAssign
void opOpAssign(U other)

Appends a string to this string.

opPostMove
void opPostMove(typeof(this) other)

Move "constructor"

resize
void resize(size_t newLength)

Resizes the string.

reverse
auto ref reverse()

Reverses the contents of the string

take
immutable(T)[] take()

Take ownership of the memory owned by the string.

Properties

empty
bool empty [@property getter]

Whether the string is empty.

length
size_t length [@property getter]

The length of the string.

ptr
const(T)* ptr [@property getter]

Gets a C string pointer to the nstring.

realLength
size_t realLength [@property getter]

Gets the length of the string, with the null terminator.

usage
size_t usage [@property getter]

The length of the string, in bytes.

value
immutable(T)[] value [@property getter]

Gets the internal memory slice.

Meta