Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
fmt::BasicCStringRef< Char > Class Template Reference

#include <format.h>

Public Member Functions

 BasicCStringRef (const Char *s)
 
template<typename Allocator >
 BasicCStringRef (const std::basic_string< Char, std::char_traits< Char >, Allocator > &s)
 
const Char * c_str () const
 

Private Attributes

const Char * data_
 

Detailed Description

template<typename Char>
class fmt::BasicCStringRef< Char >

\rst A reference to a null terminated string. It can be constructed from a C string or std::basic_string.

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

+----------—+-----------------------—+ | Type | Definition | +=============+==========================+ | CStringRef | BasicCStringRef<char> | +----------—+-----------------------—+ | WCStringRef | BasicCStringRef<wchar_t> | +----------—+-----------------------—+

This class is most useful as a parameter type to allow passing different types of strings to a function, for example::

template <typename... Args> std::string format(CStringRef format_str, const Args & ... args);

format("{}", 42); format(std::string("{}"), 42); \endrst

Definition at line 658 of file format.h.

Constructor & Destructor Documentation

◆ BasicCStringRef() [1/2]

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

Constructs a string reference object from a C string.

Definition at line 664 of file format.h.

◆ BasicCStringRef() [2/2]

template<typename Char >
template<typename Allocator >
fmt::BasicCStringRef< Char >::BasicCStringRef ( const std::basic_string< Char, std::char_traits< Char >, Allocator > & s)
inline

\rst Constructs a string reference from a std::basic_string object. \endrst

Definition at line 672 of file format.h.

Member Function Documentation

◆ c_str()

template<typename Char >
const Char * fmt::BasicCStringRef< Char >::c_str ( ) const
inline

Returns the pointer to a C string.

Definition at line 677 of file format.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ data_

template<typename Char >
const Char* fmt::BasicCStringRef< Char >::data_
private

Definition at line 660 of file format.h.


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