Rihen Rihen NkentseuDocumentation
Development version, not published. Built from main: it shows what is coming (fixes, descriptions written since the last tag) and can change with every commit. Go to the stable version 0.1.0-beta.11

NkEnvString

class

Dynamically allocated character string (without the STL)

Include
#include "NKPlatform/NkEnv.h"
Namespace
nkentseu::env
Link (Jenga)
nkentseudependson(["NKPlatform"])
C++
class NkEnvString

Hierarchy

Base classes : none. Derived classes : none.

Hierarchy : NkEnvStringNkEnvString

Members · 15

NkEnvStringDefault constructor (empty string)
NkEnvStringConstructor from a C string
NkEnvStringConstructor from a single character
NkEnvStringCopy constructor
NkEnvStringMove constructor
~NkEnvStringDestructor (frees the allocated memory)
operator=Copy assignment operator
operator=Move assignment operator
CStrGets the underlying C string (null-terminated)
SizeGets the length of the string (without the null terminator)
EmptyChecks whether the string is empty
ClearEmpties the string and frees the memory
operator==Equality comparison
operator!=Inequality comparison
operator<Lexicographic order comparison

Member details

NkEnvString

#
constructor
NkEnvString() noexcept

Default constructor (empty string)

NkEnvString

#
constructor
explicit NkEnvString(const char *str)

Constructor from a C string

Parameters

NameTypeRoleDefault
strconst char *

NkEnvString

#
constructor
explicit NkEnvString(char ch)

Constructor from a single character

Parameters

NameTypeRoleDefault
chchar

NkEnvString

#
constructor
NkEnvString(const NkEnvString &other)

Copy constructor

Parameters

NameTypeRoleDefault
otherconst NkEnvString &

NkEnvString

#
constructor
NkEnvString(NkEnvString &&other) noexcept

Move constructor

Parameters

NameTypeRoleDefault
otherNkEnvString &&

~NkEnvString

#
destructor
~NkEnvString()

Destructor (frees the allocated memory)

operator=

#
method
NkEnvString &operator=(const NkEnvString &other)

Copy assignment operator

Parameters

NameTypeRoleDefault
otherconst NkEnvString &

operator=

#
method
NkEnvString &operator=(NkEnvString &&other) noexcept

Move assignment operator

Parameters

NameTypeRoleDefault
otherNkEnvString &&

CStr

#
method
const char *CStr() const noexcept

Gets the underlying C string (null-terminated)

Size

#
method
NkSize Size() const noexcept

Gets the length of the string (without the null terminator)

Empty

#
method
bool Empty() const noexcept

Checks whether the string is empty

Clear

#
method
void Clear() noexcept

Empties the string and frees the memory

operator==

#
method
bool operator==(const NkEnvString &other) const noexcept

Equality comparison

Parameters

NameTypeRoleDefault
otherconst NkEnvString &

operator!=

#
method
bool operator!=(const NkEnvString &other) const noexcept

Inequality comparison

Parameters

NameTypeRoleDefault
otherconst NkEnvString &

operator<

#
method
bool operator<(const NkEnvString &other) const noexcept

Lexicographic order comparison

Parameters

NameTypeRoleDefault
otherconst NkEnvString &