Class Ase::CString
Compact, deduplicating string variant for constant strings.
#include <memory.hh>
Public Types
Type | Name |
---|---|
typedef std::string::const_iterator | const_iterator |
typedef std::string::const_reference | const_reference |
typedef std::string::const_reverse_iterator | const_reverse_iterator |
typedef std::string::size_type | size_type |
Public Static Attributes
Type | Name |
---|---|
constexpr const std::string::size_type | npos = = -1 |
Public Functions
Type | Name |
---|---|
CString (const char * c) |
|
CString (const char * c, size_type s) |
|
CString (const std::string & s) |
|
constexpr | CString () noexcept |
constexpr | CString (const CString & c) noexcept |
constexpr | CString (CString && c) noexcept |
constexpr CString & | assign (const CString & c) noexcept |
CString & | assign (const std::string & s) noexcept |
CString & | assign (const char * c, size_type s) |
CString & | assign (const char * c) noexcept |
CString & | assign (size_type count, char ch) noexcept |
const_reference | at (size_type pos) const |
const_iterator | begin () noexcept const |
const char * | c_str () noexcept const |
size_type | capacity () noexcept const |
const_iterator | cbegin () noexcept const |
const_iterator | cend () noexcept const |
const_reverse_iterator | crbegin () noexcept const |
const_reverse_iterator | crend () noexcept const |
const char * | data () noexcept const |
bool | empty () noexcept const |
const_iterator | end () noexcept const |
size_type | length () noexcept const |
string () noexcept const |
|
constexpr CString & | operator= (const CString & c) noexcept |
constexpr CString & | operator= (CString && c) noexcept |
CString & | operator= (const std::string & s) noexcept |
CString & | operator= (const char * c) noexcept |
CString & | operator= (char ch) noexcept |
CString & | operator= (std::initializer_list< char > l) |
const_reference | operator[] (size_type pos) const |
const_reverse_iterator | rbegin () noexcept const |
const_reverse_iterator | rend () noexcept const |
size_type | size () noexcept const |
const std::string & | string () const Convert CString into a std::string. |
~CString () noexcept |
Public Static Functions
Type | Name |
---|---|
CString | lookup (const std::string & s) |
uint | temp_quark_impl (CString c) |
CString | temp_quark_impl (uint maybequark) |
Public Types Documentation
typedef const_iterator
using Ase::CString::const_iterator = std::string::const_iterator;
typedef const_reference
using Ase::CString::const_reference = std::string::const_reference;
typedef const_reverse_iterator
using Ase::CString::const_reverse_iterator = std::string::const_reverse_iterator;
typedef size_type
using Ase::CString::size_type = std::string::size_type;
Public Static Attributes Documentation
variable npos
constexpr const std::string::size_type Ase::CString::npos;
Public Functions Documentation
function CString [1/6]
inline Ase::CString::CString (
const char * c
)
function CString [2/6]
inline Ase::CString::CString (
const char * c,
size_type s
)
function CString [3/6]
inline Ase::CString::CString (
const std::string & s
)
function CString [4/6]
constexpr Ase::CString::CString () noexcept
function CString [5/6]
inline constexpr Ase::CString::CString (
const CString & c
) noexcept
function CString [6/6]
inline constexpr Ase::CString::CString (
CString && c
) noexcept
function assign [1/5]
inline constexpr CString & Ase::CString::assign (
const CString & c
) noexcept
function assign [2/5]
CString & Ase::CString::assign (
const std::string & s
) noexcept
function assign [3/5]
inline CString & Ase::CString::assign (
const char * c,
size_type s
)
function assign [4/5]
inline CString & Ase::CString::assign (
const char * c
) noexcept
function assign [5/5]
inline CString & Ase::CString::assign (
size_type count,
char ch
) noexcept
function at
inline const_reference Ase::CString::at (
size_type pos
) const
function begin
inline const_iterator Ase::CString::begin () noexcept const
function c_str
inline const char * Ase::CString::c_str () noexcept const
function capacity
inline size_type Ase::CString::capacity () noexcept const
function cbegin
inline const_iterator Ase::CString::cbegin () noexcept const
function cend
inline const_iterator Ase::CString::cend () noexcept const
function crbegin
inline const_reverse_iterator Ase::CString::crbegin () noexcept const
function crend
inline const_reverse_iterator Ase::CString::crend () noexcept const
function data
inline const char * Ase::CString::data () noexcept const
function empty
inline bool Ase::CString::empty () noexcept const
function end
inline const_iterator Ase::CString::end () noexcept const
function length
inline size_type Ase::CString::length () noexcept const
function string
inline Ase::CString::string () noexcept const
function operator=
inline constexpr CString & Ase::CString::operator= (
const CString & c
) noexcept
function operator=
inline constexpr CString & Ase::CString::operator= (
CString && c
) noexcept
function operator=
inline CString & Ase::CString::operator= (
const std::string & s
) noexcept
function operator=
inline CString & Ase::CString::operator= (
const char * c
) noexcept
function operator=
inline CString & Ase::CString::operator= (
char ch
) noexcept
function operator=
inline CString & Ase::CString::operator= (
std::initializer_list< char > l
)
function operator[]
inline const_reference Ase::CString::operator[] (
size_type pos
) const
function rbegin
inline const_reverse_iterator Ase::CString::rbegin () noexcept const
function rend
inline const_reverse_iterator Ase::CString::rend () noexcept const
function size
inline size_type Ase::CString::size () noexcept const
function string
const std::string & Ase::CString::string () const
function ~CString
inline Ase::CString::~CString () noexcept
Public Static Functions Documentation
function lookup
static CString Ase::CString::lookup (
const std::string & s
)
Lookup a previously existing CString for a std::string s
. If s
has never been assigned to a CString before, the returned CString is empty. In constrast to assign(), no new memory is allocated.
function temp_quark_impl [1/2]
static uint Ase::CString::temp_quark_impl (
CString c
)
function temp_quark_impl [2/2]
static CString Ase::CString::temp_quark_impl (
uint maybequark
)
Friends Documentation
friend operator+
inline std::string Ase::CString::operator+ (
const std::string & s,
CString c
)
friend operator+
inline std::string Ase::CString::operator+ (
CString c,
const std::string & s
)
friend operator<<
inline std::ostream & Ase::CString::operator<< (
std::ostream & os,
CString c
)
friend operator<=> [1/5]
inline std::strong_ordering Ase::CString::operator<=> (
CString a,
CString b
)
friend operator<=> [2/5]
inline std::strong_ordering Ase::CString::operator<=> (
CString a,
const String & b
)
friend operator<=> [3/5]
inline std::strong_ordering Ase::CString::operator<=> (
const String & a,
CString b
)
friend operator<=> [4/5]
inline std::strong_ordering Ase::CString::operator<=> (
CString a,
const char * b
)
friend operator<=> [5/5]
inline std::strong_ordering Ase::CString::operator<=> (
const char * a,
CString b
)
friend operator==
inline bool Ase::CString::operator== (
CString a,
CString b
)
friend operator==
inline bool Ase::CString::operator== (
CString a,
const std::string & b
)
friend operator==
inline bool Ase::CString::operator== (
const std::string & a,
CString b
)
friend operator==
inline bool Ase::CString::operator== (
CString a,
const char * b
)
friend operator==
inline bool Ase::CString::operator== (
const char * a,
CString b
)
The documentation for this class was generated from the following file /__w/anklang/anklang/ase/memory.hh