neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::string Class Reference

#include <string.hpp>

Inheritance diagram for neolib::string:
neolib::reference_counted< i_string > neolib::i_string neolib::i_contiguous_random_access_container< char > neolib::i_random_access_container< T > neolib::i_sequence_container< T, i_random_access_const_iterator< T >, i_random_access_iterator< T > > neolib::i_container< T, ConstIteratorType, IteratorType > neolib::i_reference_counted neogfx::translatable_string

Public Types

typedef i_string abstract_type
 
typedef char value_type
 
typedef std::string std_type
 
- Public Types inherited from neolib::i_string
typedef self_type abstract_type
 
- Public Types inherited from neolib::i_contiguous_random_access_container< char >
typedef self_type abstract_type
 
typedef offset_iterator< const value_typeconst_iterator
 
typedef offset_iterator< value_typeiterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
- Public Types inherited from neolib::i_random_access_container< T >
typedef self_type abstract_type
 
- Public Types inherited from neolib::i_sequence_container< T, i_random_access_const_iterator< T >, i_random_access_iterator< T > >
typedef self_type abstract_type
 
typedef T value_type
 
typedef size_t size_type
 
typedef abstract_const_iterator::iterator_wrapper const_iterator
 
typedef abstract_iterator::iterator_wrapper iterator
 
typedef i_random_access_const_iterator< T > abstract_const_iterator
 
typedef i_random_access_iterator< T > abstract_iterator
 
- Public Types inherited from neolib::i_container< T, ConstIteratorType, IteratorType >
typedef T value_type
 
typedef size_t size_type
 
typedef ConstIteratorType abstract_const_iterator
 
typedef IteratorType abstract_iterator
 
typedef abstract_const_iterator::iterator_wrapper const_iterator
 
typedef abstract_iterator::iterator_wrapper iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 

Public Member Functions

 string (size_type aCount, value_type aChar)
 
 string (const char *aString)
 
 string (const char *aString, std::size_t aLength)
 
 string (const std::string &aString={})
 
 string (const std::string_view &aStringView)
 
 string (const neolib::quick_string &aOther)
 
 string (const string &aOther)
 
 string (string &&aOther)
 
 string (const i_string &aOther)
 
template<typename Iter , typename SFINAE = std::enable_if_t<!std::is_scalar_v<Iter>, sfinae>>
 string (Iter aBegin, Iter aEnd)
 
 ~string ()
 
stringoperator= (const string &aOther)
 
stringoperator= (string &&aOther)
 
stringoperator= (const i_string &aOther) final
 
const std_typeas_std_string () const
 
std_typeas_std_string ()
 
std::string to_std_string () const
 
std::string_view to_std_string_view () const noexcept
 
size_type size () const noexcept final
 
size_type max_size () const noexcept final
 
void clear () final
 
void assign (const i_container &aOther) final
 
size_type capacity () const final
 
void reserve (size_type aCapacity) final
 
void resize (size_type aSize) final
 
void resize (size_type aSize, const value_type &aValue) final
 
void push_back (const value_type &aValue) final
 
void pop_back () final
 
const value_typefront () const final
 
value_typefront () final
 
const value_typeback () const final
 
value_typeback () final
 
const value_typeat (size_type aIndex) const final
 
value_typeat (size_type aIndex) final
 
const value_typeoperator[] (size_type aIndex) const final
 
value_typeoperator[] (size_type aIndex) final
 
const charcdata () const noexcept final
 
const chardata () const noexcept final
 
chardata () noexcept final
 
const charc_str () const noexcept final
 
void assign (const string &aOther)
 
void assign (const i_string &aOther) final
 
void assign (const char *aSource, size_type aSourceLength) final
 
void append (const string &aOther)
 
void append (const i_string &aOther) final
 
void append (const char *aSource, size_type aSourceLength) final
 
void replace_all (const i_string &aSearch, const i_string &aReplace) final
 
void assign (string &&aOther)
 
virtual void assign (const i_string &aOther)=0
 
virtual void assign (const value_type *aSource, size_type aSourceLength)=0
 
void assign (const std::string &aSource)
 
void assign (const std::string_view &aSource)
 
virtual void append (const i_string &aOther)=0
 
virtual void append (const value_type *aSource, size_type aSourceLength)=0
 
void append (const std::string &aSource)
 
void append (const std::string_view &aSource)
 
- Public Member Functions inherited from neolib::reference_counted< i_string >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_typerelease_and_take_ownership () const override
 
base_typerelease_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 
- Public Member Functions inherited from neolib::i_string
virtual void assign (const value_type *aSource, size_type aSourceLength)=0
 
virtual void append (const value_type *aSource, size_type aSourceLength)=0
 
 operator std::string () const
 
i_stringoperator= (const std::string &aOther)
 
size_type length () const
 
void assign (const std::string &aSource)
 
void assign (const std::string_view &aSource)
 
void append (const std::string &aSource)
 
void append (const std::string_view &aSource)
 
std::string to_std_string () const
 
std::string_view to_std_string_view () const noexcept
 
- Public Member Functions inherited from neolib::i_contiguous_random_access_container< char >
const_iterator cbegin () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator cend () const
 
const_iterator end () const
 
iterator end ()
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator rbegin () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator crend () const
 
const_reverse_iterator rend () const
 
reverse_iterator rend ()
 
iterator insert (const const_iterator &aPosition, const value_type &aValue)
 
iterator erase (const const_iterator &aPosition)
 
- Public Member Functions inherited from neolib::i_sequence_container< T, i_random_access_const_iterator< T >, i_random_access_iterator< T > >
virtual void resize (size_type aSize, const value_type &aValue)=0
 
iterator insert (const abstract_iterator &aPosition, const value_type &aValue)
 
iterator insert (const abstract_const_iterator &aPosition, const value_type &aValue)
 
virtual void push_back (const value_type &aValue)=0
 
- Public Member Functions inherited from neolib::i_container< T, ConstIteratorType, IteratorType >
bool empty () const noexcept
 
const_iterator cbegin () const
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator cend () const
 
const_iterator end () const
 
iterator end ()
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator rbegin () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator crend () const
 
const_reverse_iterator rend () const
 
reverse_iterator rend ()
 
iterator erase (const abstract_iterator &aPosition)
 
iterator erase (const abstract_const_iterator &aPosition)
 
iterator erase (const abstract_iterator &aFirst, const abstract_iterator &aLast)
 
iterator erase (const abstract_const_iterator &aFirst, const abstract_const_iterator &aLast)
 
i_containeroperator= (const i_container &aRhs)
 
- Public Member Functions inherited from neolib::i_reference_counted
virtual ~i_reference_counted ()=default
 

Protected Types

typedef container::random_access_const_iterator< char, std::string::const_iterator > container_const_iterator
 
typedef container::random_access_iterator< char, std::string::iterator, std::string::const_iterator > container_iterator
 
typedef container_const_iterator::abstract_const_iterator abstract_const_iterator
 
typedef container_iterator::abstract_iterator abstract_iterator
 
- Protected Types inherited from neolib::i_container< T, ConstIteratorType, IteratorType >
typedef i_container< T, ConstIteratorType, IteratorTypegeneric_container_type
 

Detailed Description

Definition at line 51 of file string.hpp.

Member Typedef Documentation

◆ abstract_const_iterator

typedef container_const_iterator::abstract_const_iterator neolib::string::abstract_const_iterator
protected

Definition at line 62 of file string.hpp.

◆ abstract_iterator

typedef container_iterator::abstract_iterator neolib::string::abstract_iterator
protected

Definition at line 63 of file string.hpp.

◆ abstract_type

◆ container_const_iterator

Definition at line 60 of file string.hpp.

◆ container_iterator

typedef container::random_access_iterator<char, std::string::iterator, std::string::const_iterator> neolib::string::container_iterator
protected

Definition at line 61 of file string.hpp.

◆ std_type

Definition at line 58 of file string.hpp.

◆ value_type

Definition at line 57 of file string.hpp.

Constructor & Destructor Documentation

◆ string() [1/10]

neolib::string::string ( size_type  aCount,
value_type  aChar 
)
inline

Definition at line 66 of file string.hpp.

◆ string() [2/10]

neolib::string::string ( const char aString)
inline

Definition at line 67 of file string.hpp.

◆ string() [3/10]

neolib::string::string ( const char aString,
std::size_t  aLength 
)
inline

Definition at line 68 of file string.hpp.

◆ string() [4/10]

neolib::string::string ( const std::string &  aString = {})
inline

Definition at line 69 of file string.hpp.

◆ string() [5/10]

neolib::string::string ( const std::string_view &  aStringView)
inline

Definition at line 70 of file string.hpp.

◆ string() [6/10]

neolib::string::string ( const neolib::quick_string aOther)
inline

Definition at line 71 of file string.hpp.

◆ string() [7/10]

neolib::string::string ( const string aOther)
inline

Definition at line 72 of file string.hpp.

◆ string() [8/10]

neolib::string::string ( string &&  aOther)
inline

Definition at line 73 of file string.hpp.

◆ string() [9/10]

neolib::string::string ( const i_string aOther)
inline

Definition at line 74 of file string.hpp.

◆ string() [10/10]

template<typename Iter , typename SFINAE = std::enable_if_t<!std::is_scalar_v<Iter>, sfinae>>
neolib::string::string ( Iter  aBegin,
Iter  aEnd 
)
inline

Definition at line 76 of file string.hpp.

◆ ~string()

neolib::string::~string ( )
inline

Definition at line 77 of file string.hpp.

Member Function Documentation

◆ append() [1/7]

void neolib::string::append ( const char aSource,
size_type  aSourceLength 
)
inlinefinal

Definition at line 135 of file string.hpp.

◆ append() [2/7]

void neolib::string::append ( const i_string aOther)
inlinefinalvirtual

Implements neolib::i_string.

Definition at line 134 of file string.hpp.

◆ append() [3/7]

virtual void neolib::i_string::append ( const i_string aOther)
virtual

Implements neolib::i_string.

◆ append() [4/7]

void neolib::i_string::append ( const std::string &  aSource)
inline

Definition at line 73 of file i_string.hpp.

◆ append() [5/7]

void neolib::i_string::append ( const std::string_view &  aSource)
inline

Definition at line 74 of file i_string.hpp.

◆ append() [6/7]

void neolib::string::append ( const string aOther)
inline

Definition at line 133 of file string.hpp.

◆ append() [7/7]

virtual void neolib::i_string::append ( const value_type aSource,
size_type  aSourceLength 
)

◆ as_std_string() [1/2]

std_type & neolib::string::as_std_string ( )
inline

Definition at line 84 of file string.hpp.

◆ as_std_string() [2/2]

const std_type & neolib::string::as_std_string ( ) const
inline

Definition at line 83 of file string.hpp.

◆ assign() [1/9]

void neolib::string::assign ( const char aSource,
size_type  aSourceLength 
)
inlinefinal

Definition at line 132 of file string.hpp.

◆ assign() [2/9]

void neolib::string::assign ( const i_container aOther)
inlinefinalvirtual

◆ assign() [3/9]

void neolib::string::assign ( const i_string aOther)
inlinefinalvirtual

Implements neolib::i_string.

Definition at line 131 of file string.hpp.

◆ assign() [4/9]

virtual void neolib::i_string::assign ( const i_string aOther)
virtual

Implements neolib::i_string.

◆ assign() [5/9]

void neolib::i_string::assign ( const std::string &  aSource)
inline

Definition at line 71 of file i_string.hpp.

◆ assign() [6/9]

void neolib::i_string::assign ( const std::string_view &  aSource)
inline

Definition at line 72 of file i_string.hpp.

◆ assign() [7/9]

void neolib::string::assign ( const string aOther)
inline

Definition at line 130 of file string.hpp.

◆ assign() [8/9]

virtual void neolib::i_string::assign ( const value_type aSource,
size_type  aSourceLength 
)

◆ assign() [9/9]

void neolib::string::assign ( string &&  aOther)
inline

Definition at line 141 of file string.hpp.

◆ at() [1/2]

const value_type & neolib::string::at ( size_type  aIndex) const
inlinefinalvirtual

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 118 of file string.hpp.

◆ at() [2/2]

value_type & neolib::string::at ( size_type  aIndex)
inlinefinalvirtual

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 119 of file string.hpp.

◆ back() [1/2]

const value_type & neolib::string::back ( ) const
inlinefinalvirtual

◆ back() [2/2]

value_type & neolib::string::back ( )
inlinefinalvirtual

◆ c_str()

const char * neolib::string::c_str ( ) const
inlinefinalvirtualnoexcept

Implements neolib::i_string.

Definition at line 129 of file string.hpp.

◆ capacity()

size_type neolib::string::capacity ( ) const
inlinefinalvirtual

◆ cdata()

const char * neolib::string::cdata ( ) const
inlinefinalvirtualnoexcept

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 126 of file string.hpp.

◆ clear()

void neolib::string::clear ( )
inlinefinalvirtual

◆ data() [1/2]

const char * neolib::string::data ( ) const
inlinefinalvirtualnoexcept

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 127 of file string.hpp.

◆ data() [2/2]

char * neolib::string::data ( )
inlinefinalvirtualnoexcept

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 128 of file string.hpp.

◆ front() [1/2]

const value_type & neolib::string::front ( ) const
inlinefinalvirtual

◆ front() [2/2]

value_type & neolib::string::front ( )
inlinefinalvirtual

◆ max_size()

size_type neolib::string::max_size ( ) const
inlinefinalvirtualnoexcept

◆ operator=() [1/3]

string & neolib::string::operator= ( const i_string aOther)
inlinefinalvirtual

Implements neolib::i_string.

Definition at line 80 of file string.hpp.

◆ operator=() [2/3]

string & neolib::string::operator= ( const string aOther)
inline

Definition at line 78 of file string.hpp.

◆ operator=() [3/3]

string & neolib::string::operator= ( string &&  aOther)
inline

Definition at line 79 of file string.hpp.

◆ operator[]() [1/2]

const value_type & neolib::string::operator[] ( size_type  aIndex) const
inlinefinalvirtual

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 120 of file string.hpp.

◆ operator[]() [2/2]

value_type & neolib::string::operator[] ( size_type  aIndex)
inlinefinalvirtual

Implements neolib::i_contiguous_random_access_container< char >.

Definition at line 121 of file string.hpp.

◆ pop_back()

void neolib::string::pop_back ( )
inlinefinalvirtual

◆ push_back()

void neolib::string::push_back ( const value_type aValue)
inlinefinal

Definition at line 108 of file string.hpp.

◆ replace_all()

void neolib::string::replace_all ( const i_string aSearch,
const i_string aReplace 
)
inlinefinalvirtual

Implements neolib::i_string.

Definition at line 137 of file string.hpp.

◆ reserve()

void neolib::string::reserve ( size_type  aCapacity)
inlinefinalvirtual

◆ resize() [1/2]

void neolib::string::resize ( size_type  aSize)
inlinefinalvirtual

◆ resize() [2/2]

void neolib::string::resize ( size_type  aSize,
const value_type aValue 
)
inlinefinal

Definition at line 107 of file string.hpp.

◆ size()

size_type neolib::string::size ( ) const
inlinefinalvirtualnoexcept

◆ to_std_string()

std::string neolib::string::to_std_string ( ) const
inline

Definition at line 85 of file string.hpp.

◆ to_std_string_view()

std::string_view neolib::string::to_std_string_view ( ) const
inlinenoexcept

Definition at line 86 of file string.hpp.


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