Public Member Functions | Private Types | Private Attributes | List of all members
internal::printf_width_handler< Char > Class Template Reference

#include <printf.h>

Inheritance diagram for internal::printf_width_handler< Char >:
internal::function< unsigned >

Public Member Functions

 printf_width_handler (format_specs &spec)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, unsigned >::type operator() (T value)
 
template<typename T >
std::enable_if<!std::is_integral< T >::value, unsigned >::type operator() (T)
 

Private Types

typedef basic_format_specs< Char > format_specs
 

Private Attributes

format_specsspec_
 

Detailed Description

template<typename Char>
class internal::printf_width_handler< Char >

Definition at line 288 of file printf.h.

Member Typedef Documentation

template<typename Char >
typedef basic_format_specs<Char> internal::printf_width_handler< Char >::format_specs
private

Definition at line 290 of file printf.h.

Constructor & Destructor Documentation

template<typename Char >
internal::printf_width_handler< Char >::printf_width_handler ( format_specs spec)
inlineexplicit

Definition at line 295 of file printf.h.

295 : spec_(spec) {}

Member Function Documentation

template<typename Char >
template<typename T >
std::enable_if<std::is_integral<T>::value, unsigned>::type internal::printf_width_handler< Char >::operator() ( value)
inline

Definition at line 299 of file printf.h.

299  {
300  typedef typename internal::int_traits<T>::main_type UnsignedType;
301  UnsignedType width = static_cast<UnsignedType>(value);
304  width = 0 - width;
305  }
306  unsigned int_max = std::numeric_limits<int>::max();
307  if (width > int_max)
308  FMT_THROW(format_error("number is too big"));
309  return static_cast<unsigned>(width);
310  }
alignment align_
Definition: format.h:1092
#define FMT_THROW(x)
Definition: format.h:115
const double width
static int max(int a, int b)
FMT_CONSTEXPR std::enable_if< std::numeric_limits< T >::is_signed, bool >::type is_negative(T value)
Definition: format.h:727
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
template<typename Char >
template<typename T >
std::enable_if<!std::is_integral<T>::value, unsigned>::type internal::printf_width_handler< Char >::operator() ( )
inline

Definition at line 314 of file printf.h.

314  {
315  FMT_THROW(format_error("width is not integer"));
316  return 0;
317  }
#define FMT_THROW(x)
Definition: format.h:115

Member Data Documentation

template<typename Char >
format_specs& internal::printf_width_handler< Char >::spec_
private

Definition at line 292 of file printf.h.


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