Wraps a C string into a class. More...
Public Member Functions | |
| c_string (const char_type *s=nullptr) | |
| Creates a new object from the given array. More... | |
| c_string (const char_type *s, const std::size_t length) | |
| Creates a new object from the given array. More... | |
| c_string (c_string const &other) | |
| c_string (c_string &&other) noexcept | |
| c_string & | operator= (c_string const &other) |
| c_string & | operator= (c_string &&other) noexcept |
| size_type | size (void) const noexcept |
| Returns the size of the string. More... | |
| size_type | length (void) const noexcept |
| Returns the size of the string. More... | |
| const char_type * | c_str (void) const noexcept |
| Returns the internal C representation of the string. More... | |
| operator const char_type * (void) noexcept | |
| void | reset (char_type *s=nullptr, const std::size_t len=0) |
| Resets the c_string with the given string and size. More... | |
Public Types | |
| typedef std::size_t | size_type |
Wraps a C string into a class.
Provides functions to clone and find the size of the C string.
|
explicit |
Creates a new object from the given array.
It will allocate and copy the string internally.
| stapl::runtime::c_string::c_string | ( | const char_type * | s, |
| const std::size_t | length | ||
| ) |
Creates a new object from the given array.
It will allocate and copy the string internally. The length of the string is given by the length parameter.
|
noexcept |
Returns the size of the string.
\0 .
|
noexcept |
Returns the size of the string.
\0 .
|
noexcept |
Returns the internal C representation of the string.
The string returned is '\0' terminated and is valid as long as the associated c_string object is alive.
| void stapl::runtime::c_string::reset | ( | char_type * | s = nullptr, |
| const std::size_t | len = 0 |
||
| ) |
Resets the c_string with the given string and size.
1.8.13