NkEnvString
class
Dynamically allocated character string (without the STL)
Include
#include "NKPlatform/NkEnv.h"Namespace
nkentseu::envLink (Jenga)
nkentseudependson(["NKPlatform"])C++
class NkEnvStringHierarchy
Base classes : none. Derived classes : none.
Members · 15
NkEnvString | Default constructor (empty string) |
NkEnvString | Constructor from a C string |
NkEnvString | Constructor from a single character |
NkEnvString | Copy constructor |
NkEnvString | Move constructor |
~NkEnvString | Destructor (frees the allocated memory) |
operator= | Copy assignment operator |
operator= | Move assignment operator |
CStr | Gets the underlying C string (null-terminated) |
Size | Gets the length of the string (without the null terminator) |
Empty | Checks whether the string is empty |
Clear | Empties the string and frees the memory |
operator== | Equality comparison |
operator!= | Inequality comparison |
operator< | Lexicographic order comparison |
Member details
NkEnvString() noexcept
Default constructor (empty string)
Source : NkEnv.h, line 130
explicit NkEnvString(const char *str)
Constructor from a C string
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
str | const char * |
Source : NkEnv.h, line 136
explicit NkEnvString(char ch)
Constructor from a single character
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
ch | char |
Source : NkEnv.h, line 142
NkEnvString(const NkEnvString &other)
Copy constructor
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvString & |
Source : NkEnv.h, line 148
NkEnvString(NkEnvString &&other) noexcept
Move constructor
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | NkEnvString && |
Source : NkEnv.h, line 154
~NkEnvString()
Destructor (frees the allocated memory)
Source : NkEnv.h, line 159
NkEnvString &operator=(const NkEnvString &other)
Copy assignment operator
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvString & |
Source : NkEnv.h, line 170
NkEnvString &operator=(NkEnvString &&other) noexcept
Move assignment operator
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | NkEnvString && |
Source : NkEnv.h, line 177
const char *CStr() const noexcept
Gets the underlying C string (null-terminated)
Source : NkEnv.h, line 187
NkSize Size() const noexcept
Gets the length of the string (without the null terminator)
Source : NkEnv.h, line 193
bool Empty() const noexcept
Checks whether the string is empty
Source : NkEnv.h, line 199
void Clear() noexcept
Empties the string and frees the memory
Source : NkEnv.h, line 204
bool operator==(const NkEnvString &other) const noexcept
Equality comparison
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvString & |
Source : NkEnv.h, line 215
bool operator!=(const NkEnvString &other) const noexcept
Inequality comparison
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvString & |
Source : NkEnv.h, line 222
bool operator<(const NkEnvString &other) const noexcept
Lexicographic order comparison
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvString & |
Source : NkEnv.h, line 229