rapidyaml  0.13.0
parse and emit YAML, and do it fast
Integer specifiers

Classes

struct  c4::fmt::integral_< T >
 format an integral type with a custom radix More...
 
struct  c4::fmt::integral_padded_< T >
 format an integral type with a custom radix, and pad with zeroes on the left More...
 

Functions

template<class T >
integral_< T > c4::fmt::integral (T val, T radix=10)
 format an integral type with a custom radix More...
 
template<class T >
integral_< intptr_t > c4::fmt::integral (T const *val, T radix=10)
 format an integral type with a custom radix More...
 
template<class T >
integral_< intptr_t > c4::fmt::integral (std::nullptr_t, T radix=10)
 format an integral type with a custom radix More...
 
template<class T >
integral_< intptr_t > c4::fmt::hex (T *v)
 format the pointer as an hexadecimal value More...
 
template<class T >
integral_< intptr_t > c4::fmt::hex (T const *v)
 format the pointer as an hexadecimal value More...
 
template<class T >
integral_< T > c4::fmt::hex (T v)
 
template<class T >
integral_< intptr_t > c4::fmt::oct (T const *v)
 format the pointer as an octal value More...
 
template<class T >
integral_< intptr_t > c4::fmt::oct (T *v)
 format the pointer as an octal value More...
 
template<class T >
integral_< T > c4::fmt::oct (T v)
 format the integral_ argument as an octal value More...
 
template<class T >
integral_< intptr_t > c4::fmt::bin (T const *v)
 format the pointer as a binary 0-1 value More...
 
template<class T >
integral_< intptr_t > c4::fmt::bin (T *v)
 format the pointer as a binary 0-1 value More...
 
template<class T >
integral_< T > c4::fmt::bin (T v)
 format the integral_ argument as a binary 0-1 value More...
 

Variables

integral_< intptr_t > c4::fmt::hex (std::nullptr_t)
 format null as an hexadecimal value More...
 
integral_< intptr_t > c4::fmt::oct (std::nullptr_t)
 format null as an octal value More...
 
integral_< intptr_t > c4::fmt::bin (std::nullptr_t)
 format null as a binary 0-1 value More...
 

Detailed Description

Function Documentation

◆ integral() [1/3]

template<class T >
integral_<T> c4::fmt::integral ( val,
radix = 10 
)
inline

format an integral type with a custom radix

Definition at line 128 of file format.hpp.

129 {
130  return integral_<T>(val, radix);
131 }

◆ integral() [2/3]

template<class T >
integral_<intptr_t> c4::fmt::integral ( T const *  val,
radix = 10 
)
inline

format an integral type with a custom radix

Definition at line 134 of file format.hpp.

135 {
136  return integral_<intptr_t>(reinterpret_cast<intptr_t>(val), static_cast<intptr_t>(radix));
137 }

◆ integral() [3/3]

template<class T >
integral_<intptr_t> c4::fmt::integral ( std::nullptr_t  ,
radix = 10 
)
inline

format an integral type with a custom radix

Definition at line 140 of file format.hpp.

141 {
142  return integral_<intptr_t>(intptr_t(0), static_cast<intptr_t>(radix));
143 }

◆ hex() [1/3]

template<class T >
integral_<intptr_t> c4::fmt::hex ( T *  v)
inline

format the pointer as an hexadecimal value

Definition at line 148 of file format.hpp.

149 {
150  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(16));
151 }

◆ hex() [2/3]

template<class T >
integral_<intptr_t> c4::fmt::hex ( T const *  v)
inline

format the pointer as an hexadecimal value

Definition at line 154 of file format.hpp.

155 {
156  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(16));
157 }

◆ hex() [3/3]

template<class T >
integral_<T> c4::fmt::hex ( v)
inline

Definition at line 167 of file format.hpp.

168 {
169  return integral_<T>(v, T(16));
170 }

◆ oct() [1/3]

template<class T >
integral_<intptr_t> c4::fmt::oct ( T const *  v)
inline

format the pointer as an octal value

Definition at line 174 of file format.hpp.

175 {
176  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(8));
177 }

◆ oct() [2/3]

template<class T >
integral_<intptr_t> c4::fmt::oct ( T *  v)
inline

format the pointer as an octal value

Definition at line 180 of file format.hpp.

181 {
182  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(8));
183 }

◆ oct() [3/3]

template<class T >
integral_<T> c4::fmt::oct ( v)
inline

format the integral_ argument as an octal value

Definition at line 191 of file format.hpp.

192 {
193  return integral_<T>(v, T(8));
194 }

◆ bin() [1/3]

template<class T >
integral_<intptr_t> c4::fmt::bin ( T const *  v)
inline

format the pointer as a binary 0-1 value

See also
c4::raw() if you want to use a binary memcpy instead of 0-1 formatting

Definition at line 199 of file format.hpp.

200 {
201  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(2));
202 }

◆ bin() [2/3]

template<class T >
integral_<intptr_t> c4::fmt::bin ( T *  v)
inline

format the pointer as a binary 0-1 value

See also
c4::raw() if you want to use a binary memcpy instead of 0-1 formatting

Definition at line 206 of file format.hpp.

207 {
208  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(2));
209 }

◆ bin() [3/3]

template<class T >
integral_<T> c4::fmt::bin ( v)
inline

format the integral_ argument as a binary 0-1 value

See also
c4::raw() if you want to use a raw memcpy-based binary dump instead of 0-1 formatting

Definition at line 219 of file format.hpp.

220 {
221  return integral_<T>(v, T(2));
222 }

Variable Documentation

◆ hex

c4::fmt::hex ( std::nullptr_t  )
inline

format null as an hexadecimal value

format the integral_ argument as an hexadecimal value

Definition at line 160 of file format.hpp.

161 {
162  return integral_<intptr_t>(0, intptr_t(16));
163 }

◆ oct

integral_<intptr_t> c4::fmt::oct(std::nullptr_t) ( std::nullptr_t  )
inline

format null as an octal value

Definition at line 185 of file format.hpp.

186 {
187  return integral_<intptr_t>(intptr_t(0), intptr_t(8));
188 }

◆ bin

integral_<intptr_t> c4::fmt::bin(std::nullptr_t) ( std::nullptr_t  )
inline

format null as a binary 0-1 value

See also
c4::raw() if you want to use a binary memcpy instead of 0-1 formatting

Definition at line 212 of file format.hpp.

213 {
214  return integral_<intptr_t>(intptr_t(0), intptr_t(2));
215 }