rapidyaml  0.13.0
parse and emit YAML, and do it fast
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

◆ left()

template<class T >
left_<T> c4::fmt::left ( 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));
left_< T > left(T val, size_t width, char padchar=' ')
tag type to mark an argument to be aligned left.
Definition: format.hpp:519
size_t cat(substr buf, Arg const &a, Args const &...more)
serialize the arguments, concatenating them to the given fixed-size buffer.
Definition: format.hpp:653

Definition at line 519 of file format.hpp.

520 {
521  return left_<T>(val, width, padchar);
522 }

◆ center()

template<class T >
center_<T> c4::fmt::center ( 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));
center_< T > center(T val, size_t width, char padchar=' ')
tag function to mark an argument to be aligned center
Definition: format.hpp:538

Definition at line 538 of file format.hpp.

539 {
540  return center_<T>(val, width, padchar);
541 }

◆ right()

template<class T >
right_<T> c4::fmt::right ( 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));
right_< T > right(T val, size_t width, char padchar=' ')
tag function to mark an argument to be aligned right
Definition: format.hpp:557

Definition at line 557 of file format.hpp.

558 {
559  return right_<T>(val, width, padchar);
560 }