rapidyaml  0.7.0
parse and emit YAML, and do it fast
Serialization helpers

Classes

struct  c4::yml::Key< K >
 
struct  c4::yml::Key< fmt::const_base64_wrapper >
 
struct  c4::yml::Key< fmt::base64_wrapper >
 

Functions

template<class K >
Key< K > c4::yml::key (K &k)
 
Key< fmt::const_base64_wrapperc4::yml::key (fmt::const_base64_wrapper w)
 
Key< fmt::base64_wrapperc4::yml::key (fmt::base64_wrapper w)
 
template<class T >
void c4::yml::write (NodeRef *n, T const &v)
 
template<class T >
std::enable_if< ! std::is_floating_point< T >::value, bool >::type c4::yml::read (NodeRef const &n, T *v)
 convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>(). More...
 
template<class T >
std::enable_if< ! std::is_floating_point< T >::value, bool >::type c4::yml::read (ConstNodeRef const &n, T *v)
 convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>(). More...
 

Detailed Description

Function Documentation

◆ key() [1/3]

◆ key() [2/3]

Definition at line 44 of file node.hpp.

44 { return {w}; }

◆ key() [3/3]

Key<fmt::base64_wrapper> c4::yml::key ( fmt::base64_wrapper  w)
inline

Definition at line 45 of file node.hpp.

45 { return {w}; }

◆ write()

template<class T >
void c4::yml::write ( NodeRef n,
T const &  v 
)
inline

Definition at line 1602 of file node.hpp.

1603 {
1604  n->set_val_serialized(v);
1605 }

References c4::yml::NodeRef::set_val_serialized().

Referenced by c4::yml::NodeRef::operator<<().

◆ read() [1/2]

template<class T >
std::enable_if< ! std::is_floating_point< T >::value, bool >::type c4::yml::read ( NodeRef const &  n,
T *  v 
)
inline

convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>().

The full string is used.

Returns
false if the conversion failed

Definition at line 1613 of file node.hpp.

1614 {
1615  csubstr val = n.val();
1616  if(val.empty())
1617  return false;
1618  return from_chars(val, v);
1619 }
bool from_chars(ryml::csubstr buf, vec2< T > *v)

References c4::from_chars(), and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val().

Referenced by c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::operator>>().

◆ read() [2/2]

template<class T >
std::enable_if< ! std::is_floating_point<T>::value, bool>::type c4::yml::read ( ConstNodeRef const &  n,
T *  v 
)
inline

convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>().

The full string is used.

Returns
false if the conversion failed

Definition at line 1626 of file node.hpp.

1627 {
1628  csubstr val = n.val();
1629  if(val.empty())
1630  return false;
1631  return from_chars(val, v);
1632 }

References c4::from_chars(), and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val().