kanzi::SharedImmutableString Class Reference

Shared immutable string container. More...

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

Public Member Functions

 SharedImmutableString ()
 Constructor. More...
 
 SharedImmutableString (string_view content)
 Constructor. More...
 
 SharedImmutableString (const SharedImmutableString &other)
 Copy constructor. More...
 
 SharedImmutableString (KZ_RV_REF(SharedImmutableString) other)
 Move constructor. More...
 
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= (KZ_RV_REF(SharedImmutableString) other)
 Move operator. 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 ( KZ_RV_REF(SharedImmutableString other)
inline

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= ( KZ_RV_REF(SharedImmutableString other)
inline

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: