parsi/fixed_string.hpp
-
namespace parsi
-
template<std::size_t SizeV, typename CharT = char>
class FixedString -
Public Functions
-
inline constexpr FixedString(const std::array<char_type, array_size> &arr) noexcept
-
inline constexpr std::size_t size() const noexcept
-
inline constexpr auto as_string_view() const noexcept -> std::string_view
-
inline constexpr auto as_sized_span() const noexcept -> std::span<const char_type, array_size>
-
template<std::size_t OtherSizeV>
inline constexpr bool equals(const FixedString<OtherSizeV> &other) const noexcept
-
inline constexpr bool equals(std::string_view other) const noexcept
-
inline constexpr operator std::string_view() const & noexcept
Public Static Functions
-
static inline constexpr auto make(const char_type *arr, std::size_t size) noexcept -> std::optional<FixedString>
-
static inline constexpr auto make(const char_type (&arr)[SizeV]) noexcept -> std::optional<FixedString>
-
static inline constexpr auto make(const std::array<char_type, array_size> &arr) noexcept -> std::optional<FixedString>
-
static inline constexpr auto make(std::string_view str) noexcept -> std::optional<FixedString>
Private Members
-
const std::array<char_type, array_size> _arr = {}
-
const std::size_t _size = array_size - 1
Private Static Functions
-
static inline constexpr auto internal_make_array(std::span<const char_type> bytes) noexcept -> std::array<char_type, array_size>
Friends
- template<std::size_t RhsSizeV> inline friend constexpr friend bool operator== (const FixedString &lhs, const FixedString< RhsSizeV > &rhs) noexcept
- inline friend constexpr friend bool operator== (const FixedString &lhs, std::string_view rhs) noexcept
- template<std::size_t RhsSizeV> inline friend constexpr friend bool operator!= (const FixedString &lhs, const FixedString< RhsSizeV > &rhs) noexcept
- inline friend constexpr friend bool operator!= (const FixedString &lhs, std::string_view rhs) noexcept
-
inline constexpr FixedString(const std::array<char_type, array_size> &arr) noexcept
-
template<std::size_t SizeV, typename CharT = char>