OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::fixed_size_string< N > Class Template Reference

String with maximum fixed-size internal storage. More...

#include <eagine/fixed_size_str.hpp>

Public Types

using size_type = span_size_t
 Alias for length type.
 
using iterator = char *
 Alias for iterator type.
 
using const_iterator = const char *
 Alias for const iterator type.
 

Public Member Functions

 fixed_size_string () noexcept
 Default construction. More...
 
template<typename... C, typename = std::enable_if_t<sizeof...(C) == N>>
constexpr fixed_size_string (C... c) noexcept
 Construction from a pack of characters.
 
 fixed_size_string (const char(&s)[N]) noexcept
 Construction from a C-string literal.
 
auto empty () const noexcept
 Indicates if the string is empty.
 
auto size () const noexcept -> span_size_t
 Returns the size of the string.
 
auto data () const noexcept
 Returns pointer to the internally-stored character data.
 
auto c_str () const noexcept
 Returns pointer to the internally-stored character data. More...
 
auto begin () noexcept -> iterator
 Returns iterator to the start of the string.
 
auto begin () const noexcept -> const_iterator
 Returns const iterator to the start of the string.
 
auto end () noexcept -> iterator
 Returns iterator past the end of the string.
 
auto end () const noexcept -> const_iterator
 Returns const iterator past the end of the string.
 
auto view () const noexcept -> string_view
 Returns a view over the internal character data storage.
 
 operator string_view () const noexcept
 Returns a view over the internal character data storage. More...
 

Detailed Description

template<span_size_t N>
class eagine::fixed_size_string< N >

String with maximum fixed-size internal storage.

Constructor & Destructor Documentation

◆ fixed_size_string()

template<span_size_t N>
eagine::fixed_size_string< N >::fixed_size_string ( )
inlinenoexcept

Default construction.

Postcondition
empty

Member Function Documentation

◆ c_str()

template<span_size_t N>
auto eagine::fixed_size_string< N >::c_str ( ) const
inlinenoexcept

Returns pointer to the internally-stored character data.

This function ensures that the internal storage is zero terminated.

◆ operator string_view()

template<span_size_t N>
eagine::fixed_size_string< N >::operator string_view ( ) const
inlinenoexcept

Returns a view over the internal character data storage.

See also
view

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).