Kanzi 3.9.10
kanzi::SharedImmutableString Class Reference

Shared immutable string container. More...

#include <kanzi/core/string/shared_immutable_string.hpp>

Public Member Functions

const charc_str () const
 Access string data.
 
 operator string_view () const
 string_view operator.
 
SharedImmutableStringoperator= (const SharedImmutableString &other)
 Assignment operator.
 
SharedImmutableStringoperator= (SharedImmutableString &&other) noexcept
 Move operator.
 
 SharedImmutableString ()
 Constructor.
 
 SharedImmutableString (const SharedImmutableString &other)
 Copy constructor.
 
 SharedImmutableString (SharedImmutableString &&other) noexcept
 Move constructor.
 
 SharedImmutableString (string_view content)
 Constructor.
 

Friends

void swap (SharedImmutableString &left, SharedImmutableString &right)
 Swap operation.
 

Detailed Description

Shared immutable string container.

Represents a shared string that is allocated dynamically but cannot be changed.

Constructor & Destructor Documentation

◆ SharedImmutableString() [1/4]

kanzi::SharedImmutableString::SharedImmutableString ( )
inlineexplicit

Constructor.

◆ SharedImmutableString() [2/4]

kanzi::SharedImmutableString::SharedImmutableString ( string_view content)
inlineexplicit

Constructor.

Parameters
contentString to construct from.

◆ SharedImmutableString() [3/4]

kanzi::SharedImmutableString::SharedImmutableString ( const SharedImmutableString & other)
inline

Copy constructor.

Parameters
otherSource string.

◆ SharedImmutableString() [4/4]

kanzi::SharedImmutableString::SharedImmutableString ( SharedImmutableString && other)
inlinenoexcept

Move constructor.

Parameters
otherSource string.

Member Function Documentation

◆ c_str()

const char * kanzi::SharedImmutableString::c_str ( ) const
inline

Access string data.

Returns
C string.

◆ operator string_view()

kanzi::SharedImmutableString::operator string_view ( ) const
inline

string_view operator.

Returns
View to contained string.

◆ operator=() [1/2]

SharedImmutableString & kanzi::SharedImmutableString::operator= ( const SharedImmutableString & other)
inline

Assignment operator.

Parameters
otherSource string.
Returns
This.

◆ operator=() [2/2]

SharedImmutableString & kanzi::SharedImmutableString::operator= ( SharedImmutableString && other)
inlinenoexcept

Move operator.

Parameters
otherSource string.
Returns
This.

Friends And Related Symbol Documentation

◆ swap

void swap ( SharedImmutableString & left,
SharedImmutableString & right )
friend

Swap operation.

Parameters
leftLeft operand.
rightRight operand.

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