Public Member Functions | Public Attributes | List of all members
internal::prettify_handler Struct Reference

#include <format-inl.h>

Public Member Functions

 prettify_handler (buffer &b, ptrdiff_t n)
 
 ~prettify_handler ()
 
template<typename F >
void insert (ptrdiff_t pos, ptrdiff_t n, F f)
 
void insert (ptrdiff_t pos, char c)
 
void append (ptrdiff_t n, char c)
 
void append (char c)
 
void remove_trailing (char c)
 

Public Attributes

char * data
 
ptrdiff_t size
 
bufferbuf
 

Detailed Description

Definition at line 548 of file format-inl.h.

Constructor & Destructor Documentation

internal::prettify_handler::prettify_handler ( buffer b,
ptrdiff_t  n 
)
inlineexplicit

Definition at line 553 of file format-inl.h.

554  : data(b.data()), size(n), buf(b) {}
T * data() FMT_NOEXCEPT
Definition: core.h:256
std::size_t n
Definition: format.h:3399
internal::prettify_handler::~prettify_handler ( )
inline

Definition at line 555 of file format-inl.h.

555  {
556  assert(buf.size() >= to_unsigned(size));
558  }
void resize(std::size_t new_size)
Definition: core.h:264
std::size_t size() const FMT_NOEXCEPT
Definition: core.h:250
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
Definition: core.h:208

Member Function Documentation

void internal::prettify_handler::append ( ptrdiff_t  n,
char  c 
)
inline

Definition at line 573 of file format-inl.h.

573  {
574  std::uninitialized_fill_n(data + size, n, c);
575  size += n;
576  }
std::size_t n
Definition: format.h:3399
void internal::prettify_handler::append ( char  c)
inline

Definition at line 578 of file format-inl.h.

template<typename F >
void internal::prettify_handler::insert ( ptrdiff_t  pos,
ptrdiff_t  n,
f 
)
inline

Definition at line 561 of file format-inl.h.

561  {
562  std::memmove(data + pos + n, data + pos, to_unsigned(size - pos));
563  f(data + pos);
564  size += n;
565  }
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
Definition: core.h:208
std::size_t n
Definition: format.h:3399
void internal::prettify_handler::insert ( ptrdiff_t  pos,
char  c 
)
inline

Definition at line 567 of file format-inl.h.

567  {
568  std::memmove(data + pos + 1, data + pos, to_unsigned(size - pos));
569  data[pos] = c;
570  ++size;
571  }
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
Definition: core.h:208
void internal::prettify_handler::remove_trailing ( char  c)
inline

Definition at line 580 of file format-inl.h.

580  {
581  while (data[size - 1] == c) --size;
582  }

Member Data Documentation

buffer& internal::prettify_handler::buf

Definition at line 551 of file format-inl.h.

char* internal::prettify_handler::data

Definition at line 549 of file format-inl.h.

ptrdiff_t internal::prettify_handler::size

Definition at line 550 of file format-inl.h.


The documentation for this struct was generated from the following file: