rapidyaml  0.12.1
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 132 of file format.hpp.

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

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

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

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

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

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

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

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

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

◆ hex() [3/3]

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

Definition at line 171 of file format.hpp.

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

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

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

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

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

◆ oct() [3/3]

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

format the integral_ argument as an octal value

Definition at line 195 of file format.hpp.

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

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

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

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

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

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

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

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

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

◆ oct

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

format null as an octal value

Definition at line 189 of file format.hpp.

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

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

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