nlib
nn::nlib::msgpack::MpObjectAsString Class Referencefinal

The class for providing access with character elements for MpObject that has the string (ASCII or UTF-8) type. More...

#include "nn/nlib/msgpack/MpObject.h"

Public Types

typedef nlib_utf8_titerator
 A random-access iterator.
 
typedef const nlib_utf8_tconst_iterator
 Read-only random-access iterator.
 
typedef std::reverse_iterator< iteratorreverse_iterator
 A reverse iterator.
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Read-only reverse iterator.
 
typedef nlib_utf8_treference
 A reference to an element.
 
typedef const nlib_utf8_tconst_reference
 Read-only reference to an element.
 

Public Member Functions

 MpObjectAsString (MpObject &obj) noexcept
 
iterator begin () noexcept
 Gets the iterator pointing to the first element.
 
iterator end () noexcept
 Gets the iterator pointing beyond the last element.
 
const_iterator begin () const noexcept
 Gets the read-only iterator pointing to the first element.
 
const_iterator end () const noexcept
 Gets the read-only iterator pointing beyond the last element.
 
reverse_iterator rbegin () noexcept
 Gets the reverse iterator pointing to the last element.
 
reverse_iterator rend () noexcept
 Gets the reverse iterator pointing ahead of the first element.
 
const_reverse_iterator rbegin () const noexcept
 Gets the read-only reverse iterator pointing to the last element.
 
const_reverse_iterator rend () const noexcept
 Gets the read-only reverse iterator pointing ahead of the first element.
 
reference operator[] (size_t n) noexcept
 Returns a reference to the character at the specified position.
 
const_reference operator[] (size_t n) const noexcept
 The const decoration version of the above function.
 
reference at (size_t n) noexcept
 Returns a reference to the character at the specified position.
 
const_reference at (size_t n) const noexcept
 Returns a reference to the character at the specified position.
 
uint32_t GetSize () const noexcept
 Returns the length of the string.
 
size_t size () const noexcept
 Returns the length of the string.
 
size_t length () const noexcept
 Returns the length of the string.
 
size_t max_size () const noexcept
 Returns the length of the string. (The string length is not altered).
 
bool empty () const noexcept
 Returns true for an empty string.
 
const nlib_utf8_tc_str () const noexcept
 Returns a C string.
 
const nlib_utf8_tdata () const noexcept
 Returns a C string.
 

Detailed Description

The class for providing access with character elements for MpObject that has the string (ASCII or UTF-8) type.

Description
An iterator points to byte data, instead of a code point. Note that this means an iterator may point to a middle of the code point.

Definition at line 620 of file MpObject.h.

Constructor & Destructor Documentation

◆ MpObjectAsString()

nn::nlib::msgpack::MpObjectAsString::MpObjectAsString ( MpObject obj)
inlineexplicitnoexcept
Parameters
[in]objMpObject to be accessed as a string. obj.IsString() must be true.

Definition at line 632 of file MpObject.h.


The documentation for this class was generated from the following files: