PST SDK  5.2.0.0-0eac0f6
PSTech::Utils::PstString Class Reference

#include <PstString.h>

+ Collaboration diagram for PSTech::Utils::PstString:

Public Member Functions

 PstString ()
 
 PstString (const char *string)
 
 PstString (const PstString &string)
 
 PstString (PstString &&string) noexcept
 
 ~PstString ()
 
const char * c_str () const
 
size_t length () const
 
size_t size () const
 
void resize (size_t size)
 
int compare (const PstString &string) const
 
PstStringappend (const PstString &string)
 
void clear ()
 
bool empty () const
 
PstStringoperator= (const PstString &string)
 
PstStringoperator= (PstString &&string) noexcept
 
bool operator== (const PstString &string) const
 
bool operator!= (const PstString &string) const
 
bool operator< (const PstString &string) const
 
bool operator<= (const PstString &string) const
 
bool operator> (const PstString &string) const
 
bool operator>= (const PstString &string) const
 
PstStringoperator+= (const PstString &right)
 

Private Member Functions

void copy_internal (const PstString &string)
 
void move_internal (PstString &&string) noexcept
 

Private Attributes

char * m_string
 
size_t m_size
 

Friends

PstString operator+ (PstString left, const PstString &right)
 

Detailed Description

Basic string class, cloning std::string. This class can safely be passed across the DLL boundary.

Constructor & Destructor Documentation

◆ PstString() [1/4]

PSTech::Utils::PstString::PstString ( )

Default constructor creating an empty PstString.

◆ PstString() [2/4]

PSTech::Utils::PstString::PstString ( const char *  string)

Converting constructor converting c-string ‘string’ to PstString.

◆ PstString() [3/4]

PSTech::Utils::PstString::PstString ( const PstString string)

Copy constructor.

◆ PstString() [4/4]

PSTech::Utils::PstString::PstString ( PstString &&  string)
noexcept

Move constructor.

◆ ~PstString()

PSTech::Utils::PstString::~PstString ( )

Destructor

Member Function Documentation

◆ append()

PstString& PSTech::Utils::PstString::append ( const PstString string)

Concatenates the PstString supplied by ‘string’ to this PstString.

Returns
A reference to this concatenated PstString.

◆ c_str()

const char* PSTech::Utils::PstString::c_str ( ) const

Returns a non-modifyable standard C character array version of the PstString.

◆ clear()

void PSTech::Utils::PstString::clear ( )

Destroy the contents of the PstString, leaving it empty.

◆ compare()

int PSTech::Utils::PstString::compare ( const PstString string) const

Compares this PstString to ‘string’.

  • Returns 0 if the contents of the two PstStrings is equal.
  • Returns a negative value if this PstString appears before ‘string’, in lexicographical order.
  • Returns a positive value if this PstString appears after ‘string’, in lexicographical order.

◆ copy_internal()

void PSTech::Utils::PstString::copy_internal ( const PstString string)
private

◆ empty()

bool PSTech::Utils::PstString::empty ( ) const

Returns true if this PstString contains no characters.

◆ length()

size_t PSTech::Utils::PstString::length ( ) const

Returns the number of characters in the PstString. Equivalent to PstString::size()

See also
PstString::size()

◆ move_internal()

void PSTech::Utils::PstString::move_internal ( PstString &&  string)
privatenoexcept

◆ operator!=()

bool PSTech::Utils::PstString::operator!= ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when PstStrings are not equal.

◆ operator+=()

PstString& PSTech::Utils::PstString::operator+= ( const PstString right)

Appends the string supplied by ‘right’ to this PstString.

Returns
A reference to this appended PstString.
See also
PstString::append()

◆ operator<()

bool PSTech::Utils::PstString::operator< ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when this PstString appears before ‘string’.

◆ operator<=()

bool PSTech::Utils::PstString::operator<= ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when this PstString appears before or is equal to ‘string’.

◆ operator=() [1/2]

PstString& PSTech::Utils::PstString::operator= ( const PstString string)

Assign values to the PstString by copying.

◆ operator=() [2/2]

PstString& PSTech::Utils::PstString::operator= ( PstString &&  string)
noexcept

Assign values to the PstString by moving.

◆ operator==()

bool PSTech::Utils::PstString::operator== ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when PstStrings are equal.

◆ operator>()

bool PSTech::Utils::PstString::operator> ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when this PstString appears after ‘string’.

◆ operator>=()

bool PSTech::Utils::PstString::operator>= ( const PstString string) const

Lexicographical comparison of two PstStrings.

Returns
True when this PstString appears after or is equal to ‘string’.

◆ resize()

void PSTech::Utils::PstString::resize ( size_t  size)

Changes the number of characters stored in the PstString to ‘size’ characters.

◆ size()

size_t PSTech::Utils::PstString::size ( ) const

Returns the number of characters in the PstString. Equivalent to PstString::length()

See also
PstString::length()

Friends And Related Function Documentation

◆ operator+

PstString operator+ ( PstString  left,
const PstString right 
)
friend

Concatenate the PstString supplied by ‘right’ to the PstString supplied by ‘left’.

Returns
The concatenation of the two PstStrings.
See also
PstString::append()

Member Data Documentation

◆ m_size

size_t PSTech::Utils::PstString::m_size
private

◆ m_string

char* PSTech::Utils::PstString::m_string
private

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