rapidyaml  0.7.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 131 of file format.hpp.

132 {
133  return integral_<T>(val, radix);
134 }

◆ 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 137 of file format.hpp.

138 {
139  return integral_<intptr_t>(reinterpret_cast<intptr_t>(val), static_cast<intptr_t>(radix));
140 }

◆ 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 143 of file format.hpp.

144 {
145  return integral_<intptr_t>(intptr_t(0), static_cast<intptr_t>(radix));
146 }

◆ 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 151 of file format.hpp.

152 {
153  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(16));
154 }

◆ 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 157 of file format.hpp.

158 {
159  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(16));
160 }

◆ hex() [3/3]

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

Definition at line 170 of file format.hpp.

171 {
172  return integral_<T>(v, T(16));
173 }

◆ 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 177 of file format.hpp.

178 {
179  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(8));
180 }

◆ 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 183 of file format.hpp.

184 {
185  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(8));
186 }

◆ oct() [3/3]

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

format the integral_ argument as an octal value

Definition at line 194 of file format.hpp.

195 {
196  return integral_<T>(v, T(8));
197 }

◆ 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 202 of file format.hpp.

203 {
204  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(2));
205 }

◆ 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 209 of file format.hpp.

210 {
211  return integral_<intptr_t>(reinterpret_cast<intptr_t>(v), intptr_t(2));
212 }

◆ 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 222 of file format.hpp.

223 {
224  return integral_<T>(v, T(2));
225 }

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 163 of file format.hpp.

164 {
165  return integral_<intptr_t>(0, intptr_t(16));
166 }

Referenced by sample::sample_formatting().

◆ oct

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

format null as an octal value

Definition at line 188 of file format.hpp.

189 {
190  return integral_<intptr_t>(intptr_t(0), intptr_t(8));
191 }

Referenced by sample::sample_formatting().

◆ 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 215 of file format.hpp.

216 {
217  return integral_<intptr_t>(intptr_t(0), intptr_t(2));
218 }

Referenced by sample::sample_formatting().