Kanzi  3.9.7
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

kanzi::SharedImmutableString::SharedImmutableString ( )
inlineexplicit

Constructor.

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

Constructor.

Parameters
contentString to construct from.
kanzi::SharedImmutableString::SharedImmutableString ( const SharedImmutableString other)
inline

Copy constructor.

Parameters
otherSource string.
kanzi::SharedImmutableString::SharedImmutableString ( SharedImmutableString &&  other)
inlinenoexcept

Move constructor.

Parameters
otherSource string.

Member Function Documentation

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

Access string data.

Returns
C string.
kanzi::SharedImmutableString::operator string_view ( ) const
inline

string_view operator.

Returns
View to contained string.
SharedImmutableString& kanzi::SharedImmutableString::operator= ( const SharedImmutableString other)
inline

Assignment operator.

Parameters
otherSource string.
Returns
This.
SharedImmutableString& kanzi::SharedImmutableString::operator= ( SharedImmutableString &&  other)
inlinenoexcept

Move operator.

Parameters
otherSource string.
Returns
This.

Friends And Related Function Documentation

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: