Skip to content

daisy::FixedCapStrBase

More...

#include <FixedCapStr.h>

Public Functions

Name
constexpr FixedCapStrBase(CharType * buffer, size_t capacity)
constexpr FixedCapStrBase(const FixedCapStrBase & other) =delete
constexpr FixedCapStrBase & operator=(const FixedCapStrBase & str)
constexpr FixedCapStrBase & operator=(const CharType * str)
constexpr operator const CharType *() const
constexpr const CharType * Cstr() const
constexpr const CharType * Data() const
constexpr CharType * Data()
constexpr auto Size() const
constexpr auto UpdateSize()
constexpr auto Capacity() const
constexpr auto Empty() const
constexpr void Clear()
constexpr void Reset(const CharType * str)
constexpr void Reset(const CharType * str, std::size_t length)
constexpr void ResetAt(const CharType * str, std::size_t writePosition)
constexpr void Append(const CharType singleChar)
constexpr void Append(const CharType * str)
constexpr void Append(const CharType * str, std::size_t length)
template <typename IntType >
constexpr void
AppendInt(IntType value, bool alwaysIncludeSign =false)
constexpr void AppendFloat(float value, int maxNumDigits =2, bool omitTrailingZeros =false, bool alwaysIncludeSign =false)
constexpr bool StartsWith(const CharType * pattern) const
constexpr bool StartsWithIgnoringCase(const CharType * pattern) const
constexpr bool EndsWith(const CharType * pattern) const
constexpr bool EndsWithIgnoringCase(const CharType * pattern) const
constexpr void RemovePrefix(std::size_t length)
constexpr void RemoveSuffix(std::size_t length)
constexpr void ReverseSection(std::size_t firstIdx, std::size_t lastIdx)
constexpr bool operator==(const CharType * rhs) const
constexpr bool operator!=(const CharType * rhs) const
constexpr bool operator<(const CharType * other) const
constexpr bool operator<=(const CharType * other) const
constexpr bool operator>(const CharType * other) const
constexpr bool operator>=(const CharType * other) const
constexpr void Swap(FixedCapStrBase & rhs)

Protected Functions

Name
constexpr std::size_t strlen(const CharType * string)
constexpr void Copy_(const CharType * src, const CharType * srcEnd, CharType * dest)
constexpr void Swap_(CharType * a, CharType * b, size_t length)
constexpr char ToUpper_(char c)
constexpr void Reset_(const CharType * str, std::size_t length)
constexpr void ResetAt_(const CharType * str, std::size_t strLen, std::size_t writePosition)
constexpr void Append_(const CharType * str, std::size_t to_copy)
std::size_t clamp(std::size_t val, std::size_t min, std::size_t max)

Protected Attributes

Name
std::size_t size_
const size_t capacity_
CharType * buffer_

Detailed Description

template <class CharType  =char>
class daisy::FixedCapStrBase;

Public Functions Documentation

function FixedCapStrBase

inline constexpr FixedCapStrBase(
    CharType * buffer,
    size_t capacity
)

function FixedCapStrBase

constexpr FixedCapStrBase(
    const FixedCapStrBase & other
) =delete

function operator=

inline constexpr FixedCapStrBase & operator=(
    const FixedCapStrBase & str
)

function operator=

inline constexpr FixedCapStrBase & operator=(
    const CharType * str
)

function operator const CharType *

inline constexpr operator const CharType *() const

function Cstr

inline constexpr const CharType * Cstr() const

function Data

inline constexpr const CharType * Data() const

function Data

inline constexpr CharType * Data()

function Size

inline constexpr auto Size() const

function UpdateSize

inline constexpr auto UpdateSize()

function Capacity

inline constexpr auto Capacity() const

function Empty

inline constexpr auto Empty() const

function Clear

inline constexpr void Clear()

function Reset

inline constexpr void Reset(
    const CharType * str
)

function Reset

inline constexpr void Reset(
    const CharType * str,
    std::size_t length
)

function ResetAt

inline constexpr void ResetAt(
    const CharType * str,
    std::size_t writePosition
)

function Append

inline constexpr void Append(
    const CharType singleChar
)

function Append

inline constexpr void Append(
    const CharType * str
)

function Append

inline constexpr void Append(
    const CharType * str,
    std::size_t length
)

function AppendInt

template <typename IntType >
inline constexpr void AppendInt(
    IntType value,
    bool alwaysIncludeSign =false
)

function AppendFloat

inline constexpr void AppendFloat(
    float value,
    int maxNumDigits =2,
    bool omitTrailingZeros =false,
    bool alwaysIncludeSign =false
)

function StartsWith

inline constexpr bool StartsWith(
    const CharType * pattern
) const

function StartsWithIgnoringCase

inline constexpr bool StartsWithIgnoringCase(
    const CharType * pattern
) const

function EndsWith

inline constexpr bool EndsWith(
    const CharType * pattern
) const

function EndsWithIgnoringCase

inline constexpr bool EndsWithIgnoringCase(
    const CharType * pattern
) const

function RemovePrefix

inline constexpr void RemovePrefix(
    std::size_t length
)

function RemoveSuffix

inline constexpr void RemoveSuffix(
    std::size_t length
)

function ReverseSection

inline constexpr void ReverseSection(
    std::size_t firstIdx,
    std::size_t lastIdx
)

function operator==

inline constexpr bool operator==(
    const CharType * rhs
) const

function operator!=

inline constexpr bool operator!=(
    const CharType * rhs
) const

function operator<

inline constexpr bool operator<(
    const CharType * other
) const

function operator<=

inline constexpr bool operator<=(
    const CharType * other
) const

function operator>

inline constexpr bool operator>(
    const CharType * other
) const

function operator>=

inline constexpr bool operator>=(
    const CharType * other
) const

function Swap

inline constexpr void Swap(
    FixedCapStrBase & rhs
)

Protected Functions Documentation

function strlen

static inline constexpr std::size_t strlen(
    const CharType * string
)

function Copy_

static inline constexpr void Copy_(
    const CharType * src,
    const CharType * srcEnd,
    CharType * dest
)

function Swap_

static inline constexpr void Swap_(
    CharType * a,
    CharType * b,
    size_t length
)

function ToUpper_

static inline constexpr char ToUpper_(
    char c
)

function Reset_

inline constexpr void Reset_(
    const CharType * str,
    std::size_t length
)

function ResetAt_

inline constexpr void ResetAt_(
    const CharType * str,
    std::size_t strLen,
    std::size_t writePosition
)

function Append_

inline constexpr void Append_(
    const CharType * str,
    std::size_t to_copy
)

function clamp

inline std::size_t clamp(
    std::size_t val,
    std::size_t min,
    std::size_t max
)

Protected Attributes Documentation

variable size_

std::size_t size_ {0};

variable capacity_

const size_t capacity_;

variable buffer_

CharType * buffer_;

Updated on 2024-01-03 at 19:41:00 +0000