rapidyaml  0.16.0
parseandemitYAML,anddoitfast
Alignment specifiers

Classes

struct  c4::fmt::left_< T >
 
struct  c4::fmt::center_< T >
 
struct  c4::fmt::right_< T >
 

Functions

template<class T >
left_< T > c4::fmt::left (T val, size_t width, char padchar=' ')
 tag type to mark an argument to be aligned left. More...
 
template<class T >
center_< T > c4::fmt::center (T val, size_t width, char padchar=' ')
 tag function to mark an argument to be aligned center More...
 
template<class T >
right_< T > c4::fmt::right (T val, size_t width, char padchar=' ')
 tag function to mark an argument to be aligned right More...
 

Detailed Description

Function Documentation

template<class T >
left_<T> c4::fmt::left ( T  val,
size_t  width,
char  padchar = ' ' 
)

tag type to mark an argument to be aligned left.

Parameters
valthe argument to be aligned left
widththe length of the field
padcharthe padding character, defaults to ' '
Note
This function (and the return structure) uses value semantics. To avoid copies on larger types, you can use std::cref(). For example:
char buf[512];
std::string large_string = .....;
size_t len = cat(buf, fmt::left(std::cref(large_string), 100));

Definition at line 515 of file format.hpp.

Referenced by c4::basic_substring< char >::offs(), and sample_formatting().

516 {
517  return left_<T>(val, width, padchar);
518 }
template<class T >
center_<T> c4::fmt::center ( T  val,
size_t  width,
char  padchar = ' ' 
)

tag function to mark an argument to be aligned center

Parameters
valthe argument to be aligned center
widththe length of the field
padcharthe padding character, defaults to ' '
Note
This function (and the return value) uses value semantics. To avoid copies on larger types, you can use std::cref(). For example:
char buf[512];
std::string large_string = .....;
size_t len = cat(buf, fmt::center(std::cref(large_string), 100));

Definition at line 534 of file format.hpp.

535 {
536  return center_<T>(val, width, padchar);
537 }
template<class T >
right_<T> c4::fmt::right ( T  val,
size_t  width,
char  padchar = ' ' 
)

tag function to mark an argument to be aligned right

Parameters
valthe argument to be aligned right
widththe length of the field
padcharthe padding character, defaults to ' '
Note
This function (and the return value) uses value semantics. To avoid copies on larger types, you can use std::cref(). For example:
char buf[512];
std::string large_string = .....;
size_t len = cat(buf, fmt::right(std::cref(large_string), 100));

Definition at line 553 of file format.hpp.

Referenced by c4::basic_substring< char >::offs(), and sample_formatting().

554 {
555  return right_<T>(val, width, padchar);
556 }