WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
basic_cstring_view< Char > Class Template Reference

A reference to a null-terminated string. More...

#include <fmt/os.h>

Public Member Functions

 basic_cstring_view (const Char *s)
 Constructs a string reference object from a C string.
 
 basic_cstring_view (const std::basic_string< Char > &s)
 Constructs a string reference from an std::string object.
 
auto c_str () const -> const Char *
 Returns the pointer to a C string.
 

Detailed Description

template<typename Char>
class basic_cstring_view< Char >

A reference to a null-terminated string.

It can be constructed from a C string or std::string.

You can use one of the following type aliases for common character types:

+------------—+--------------------------—+ | Type | Definition | +===============+=============================+ | cstring_view | basic_cstring_view<char> | +------------—+--------------------------—+ | wcstring_view | basic_cstring_view<wchar_t> | +------------—+--------------------------—+

This class is most useful as a parameter type for functions that wrap C APIs.

Constructor & Destructor Documentation

◆ basic_cstring_view() [1/2]

template<typename Char >
basic_cstring_view< Char >::basic_cstring_view ( const Char * s)
inline

Constructs a string reference object from a C string.

◆ basic_cstring_view() [2/2]

template<typename Char >
basic_cstring_view< Char >::basic_cstring_view ( const std::basic_string< Char > & s)
inline

Constructs a string reference from an std::string object.

Member Function Documentation

◆ c_str()

template<typename Char >
auto basic_cstring_view< Char >::c_str ( ) const -> const Char*
inline

Returns the pointer to a C string.


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