Kanzi  3.9.5
Kanzi Engine API
kanzi::SharedImmutableString Class Reference

Shared immutable string container. More...

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

Public Member Functions

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

Friends

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

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 Function 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: