Public Member Functions | Private Attributes | List of all members
fmt::BasicCStringRef< Char > Class Template Reference

#include <format.h>

Public Member Functions

 BasicCStringRef (const Char *s)
 
 BasicCStringRef (const std::basic_string< Char > &s)
 
const Char * c_str () const
 

Private Attributes

const Char * data_
 

Detailed Description

template<typename Char>
class fmt::BasicCStringRef< 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 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);

Definition at line 577 of file format.h.

Constructor & Destructor Documentation

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

Constructs a string reference object from a C string.

Definition at line 584 of file format.h.

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

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

Definition at line 591 of file format.h.

Member Function Documentation

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

Returns the pointer to a C string.

Definition at line 594 of file format.h.

Member Data Documentation

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

Definition at line 580 of file format.h.


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


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:09