Scarab  v2.9.0
Project 8 C++ Utility Library
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Static Private Member Functions | List of all members
string_caster< StringType, IsView > Struct Template Reference

#include <cast.h>

Inheritance diagram for string_caster< StringType, IsView >:
Inheritance graph

Public Types

using CharT = typename StringType::value_type
 
template<typename T_ >
using cast_op_type = pybind11::detail::movable_cast_op_type< T_ >
 

Public Member Functions

bool load (handle src, bool)
 
 operator StringType * ()
 
 operator StringType & ()
 
 operator StringType && () &&
 

Static Public Member Functions

static handle cast (const StringType &src, return_value_policy, handle)
 
template<typename T_ , enable_if_t< std::is_same< StringType, remove_cv_t< T_ >>::value, int > = 0>
static handle cast (T_ *src, return_value_policy policy, handle parent)
 

Static Public Attributes

static constexpr size_t UTF_N = 8 * sizeof(CharT)
 
static constexpr auto name = _( "unicode" )
 

Protected Attributes

StringType value
 

Private Member Functions

template<typename C = CharT>
bool load_bytes (enable_if_t< sizeof(C)==1, handle > src)
 
template<typename C = CharT>
bool load_bytes (enable_if_t< sizeof(C) !=1, handle >)
 

Static Private Member Functions

static handle decode_utfN (const char *buffer, ssize_t nbytes)
 

Detailed Description

template<typename StringType, bool IsView = false>
struct pybind11::detail::string_caster< StringType, IsView >

Definition at line 1159 of file cast.h.

Member Typedef Documentation

◆ cast_op_type

Definition at line 1221 of file cast.h.

◆ CharT

using CharT = typename StringType::value_type

Definition at line 1160 of file cast.h.

Member Function Documentation

◆ cast() [1/2]

static handle cast ( const StringType &  src,
return_value_policy  ,
handle   
)
inlinestatic

Definition at line 1213 of file cast.h.

◆ cast() [2/2]

static handle cast ( T_ *  src,
return_value_policy  policy,
handle  parent 
)
inlinestatic

Definition at line 1221 of file cast.h.

◆ decode_utfN()

static handle decode_utfN ( const char *  buffer,
ssize_t  nbytes 
)
inlinestaticprivate

Definition at line 1224 of file cast.h.

◆ load()

bool load ( handle  src,
bool   
)
inline

Definition at line 1172 of file cast.h.

◆ load_bytes() [1/2]

bool load_bytes ( enable_if_t< sizeof(C)==1, handle src)
inlineprivate

Definition at line 1243 of file cast.h.

◆ load_bytes() [2/2]

bool load_bytes ( enable_if_t< sizeof(C) !=1, handle )
inlineprivate

Definition at line 1258 of file cast.h.

◆ operator StringType &()

operator StringType & ( )
inline

Definition at line 1221 of file cast.h.

◆ operator StringType &&()

operator StringType && ( ) &&
inline

Definition at line 1221 of file cast.h.

◆ operator StringType *()

operator StringType * ( )
inline

Definition at line 1221 of file cast.h.

Member Data Documentation

◆ name

constexpr auto name = _( "unicode" )
static

Definition at line 1221 of file cast.h.

◆ UTF_N

constexpr size_t UTF_N = 8 * sizeof(CharT)
static

Definition at line 1170 of file cast.h.

◆ value

StringType value
protected

Definition at line 1221 of file cast.h.


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