rapidyaml  0.7.1
parse and emit YAML, and do it fast
Pad the number with zeroes on the left

Functions

template<class T >
integral_padded_< T > c4::fmt::zpad (T val, size_t num_digits)
 pad the argument with zeroes on the left, with decimal radix More...
 
template<class T >
integral_padded_< T > c4::fmt::zpad (integral_< T > val, size_t num_digits)
 pad the argument with zeroes on the left More...
 
integral_padded_< intptr_t > c4::fmt::zpad (std::nullptr_t, size_t num_digits)
 pad the argument with zeroes on the left More...
 
template<class T >
integral_padded_< intptr_t > c4::fmt::zpad (T const *val, size_t num_digits)
 pad the argument with zeroes on the left More...
 
template<class T >
integral_padded_< intptr_t > c4::fmt::zpad (T *val, size_t num_digits)
 

Detailed Description

Function Documentation

◆ zpad() [1/5]

template<class T >
integral_padded_<T> c4::fmt::zpad ( val,
size_t  num_digits 
)
inline

pad the argument with zeroes on the left, with decimal radix

Definition at line 235 of file format.hpp.

236 {
237  return integral_padded_<T>(val, T(10), num_digits);
238 }

Referenced by sample::sample_formatting().

◆ zpad() [2/5]

template<class T >
integral_padded_<T> c4::fmt::zpad ( integral_< T >  val,
size_t  num_digits 
)
inline

pad the argument with zeroes on the left

Definition at line 241 of file format.hpp.

242 {
243  return integral_padded_<T>(val.val, val.radix, num_digits);
244 }

References c4::fmt::integral_< T >::radix, and c4::fmt::integral_< T >::val.

◆ zpad() [3/5]

integral_padded_<intptr_t> c4::fmt::zpad ( std::nullptr_t  ,
size_t  num_digits 
)
inline

pad the argument with zeroes on the left

Definition at line 246 of file format.hpp.

247 {
248  return integral_padded_<intptr_t>(0, 16, num_digits);
249 }

◆ zpad() [4/5]

template<class T >
integral_padded_<intptr_t> c4::fmt::zpad ( T const *  val,
size_t  num_digits 
)
inline

pad the argument with zeroes on the left

Definition at line 252 of file format.hpp.

253 {
254  return integral_padded_<intptr_t>(reinterpret_cast<intptr_t>(val), 16, num_digits);
255 }

◆ zpad() [5/5]

template<class T >
integral_padded_<intptr_t> c4::fmt::zpad ( T *  val,
size_t  num_digits 
)
inline

Definition at line 257 of file format.hpp.

258 {
259  return integral_padded_<intptr_t>(reinterpret_cast<intptr_t>(val), 16, num_digits);
260 }