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

#include <format.h>

Public Member Functions

 BasicStringRef (const Char *s, std::size_t size)
 
 BasicStringRef (const Char *s)
 
 BasicStringRef (const std::basic_string< Char > &s)
 
int compare (BasicStringRef other) const
 
const Char * data () const
 
std::size_t size () const
 
std::basic_string< Char > to_string () const
 

Private Attributes

const Char * data_
 
std::size_t size_
 

Friends

bool operator!= (BasicStringRef lhs, BasicStringRef rhs)
 
bool operator< (BasicStringRef lhs, BasicStringRef rhs)
 
bool operator<= (BasicStringRef lhs, BasicStringRef rhs)
 
bool operator== (BasicStringRef lhs, BasicStringRef rhs)
 
bool operator> (BasicStringRef lhs, BasicStringRef rhs)
 
bool operator>= (BasicStringRef lhs, BasicStringRef rhs)
 

Detailed Description

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

A string reference. 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 | +============+=========================+ | StringRef | BasicStringRef<char> | +---------—+----------------------—+ | WStringRef | BasicStringRef<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(StringRef format_str, const Args & ... args);

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

Definition at line 463 of file format.h.

Constructor & Destructor Documentation

template<typename Char>
fmt::BasicStringRef< Char >::BasicStringRef ( const Char *  s,
std::size_t  size 
)
inline

Constructs a string reference object from a C string and a size.

Definition at line 471 of file format.h.

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

Constructs a string reference object from a C string computing the size with std::char_traits<Char>::length.

Definition at line 479 of file format.h.

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

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

Definition at line 487 of file format.h.

Member Function Documentation

template<typename Char>
int fmt::BasicStringRef< Char >::compare ( BasicStringRef< Char >  other) const
inline

Definition at line 513 of file format.h.

template<typename Char>
const Char* fmt::BasicStringRef< Char >::data ( ) const
inline

Returns a pointer to the string data.

Definition at line 501 of file format.h.

template<typename Char>
std::size_t fmt::BasicStringRef< Char >::size ( ) const
inline

Returns the string size.

Definition at line 507 of file format.h.

template<typename Char>
std::basic_string<Char> fmt::BasicStringRef< Char >::to_string ( ) const
inline

Converts a string reference to an std::string object.

Definition at line 495 of file format.h.

Friends And Related Function Documentation

template<typename Char>
bool operator!= ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 526 of file format.h.

template<typename Char>
bool operator< ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 530 of file format.h.

template<typename Char>
bool operator<= ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 534 of file format.h.

template<typename Char>
bool operator== ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 522 of file format.h.

template<typename Char>
bool operator> ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 538 of file format.h.

template<typename Char>
bool operator>= ( BasicStringRef< Char >  lhs,
BasicStringRef< Char >  rhs 
)
friend

Definition at line 542 of file format.h.

Member Data Documentation

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

Definition at line 466 of file format.h.

template<typename Char>
std::size_t fmt::BasicStringRef< Char >::size_
private

Definition at line 467 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