31#ifndef ETL_BASIC_FORMAT_SPEC_INCLUDED
32#define ETL_BASIC_FORMAT_SPEC_INCLUDED
37#include "static_assert.h"
43 namespace private_basic_format_spec
50 ETL_CONSTEXPR base_spec(uint_least8_t base_)
55 const uint_least8_t base;
61 ETL_CONSTEXPR width_spec(uint_least8_t width_)
66 const uint_least8_t width;
70 template <
typename TChar>
73 ETL_CONSTEXPR fill_spec(TChar fill_)
84 ETL_CONSTEXPR precision_spec(uint_least8_t precision_)
85 : precision(precision_)
89 const uint_least8_t precision;
95 ETL_CONSTEXPR uppercase_spec(
bool upper_case_)
96 : upper_case(upper_case_)
100 const bool upper_case;
104 struct boolalpha_spec
106 ETL_CONSTEXPR boolalpha_spec(
bool boolalpha_)
107 : boolalpha(boolalpha_)
111 const bool boolalpha;
117 ETL_CONSTEXPR showbase_spec(
bool show_base_)
118 : show_base(show_base_)
122 const bool show_base;
145 static ETL_CONSTEXPR private_basic_format_spec::width_spec setw(uint32_t width)
147 return private_basic_format_spec::width_spec(width);
151 template <
typename TChar>
202 template <
typename TString>
215 , left_justified_(false)
225 ETL_CONSTEXPR
basic_format_spec(uint_least8_t base__, uint_least8_t width__, uint_least8_t precision__,
bool upper_case__,
bool left_justified__,
226 bool boolalpha__,
bool show_base__,
typename TString::value_type fill__) ETL_NOEXCEPT
229 , precision_(precision__)
230 , upper_case_(upper_case__)
231 , left_justified_(left_justified__)
232 , boolalpha_(boolalpha__)
233 , show_base_(show_base__)
241 ETL_CONSTEXPR14
void clear() ETL_NOEXCEPT
247 left_justified_ =
false;
250 fill_ =
typename TString::value_type(
' ');
259 base_ =
static_cast<uint_least8_t
>(b);
267 base_ =
static_cast<uint_least8_t
>(b);
268 return etl::move(*
this);
285 return etl::move(
base(2));
302 return etl::move(
base(8));
319 return etl::move(
base(10));
336 return etl::move(
base(16));
343 ETL_CONSTEXPR uint32_t
get_base() const ETL_NOEXCEPT
363 return etl::move(*
this);
381 width_ =
static_cast<uint_least8_t
>(w);
389 width_ =
static_cast<uint_least8_t
>(w);
390 return etl::move(*
this);
408 precision_ =
static_cast<uint_least8_t
>(p);
416 precision_ =
static_cast<uint_least8_t
>(p);
417 return etl::move(*
this);
444 return etl::move(*
this);
468 ETL_CONSTEXPR14
basic_format_spec&&
fill(
typename TString::value_type c) ETL_RVALUE_REF_QUALIFIER ETL_NOEXCEPT
471 return etl::move(*
this);
478 ETL_CONSTEXPR
typename TString::value_type
get_fill() const ETL_NOEXCEPT
489 left_justified_ =
true;
497 left_justified_ =
true;
498 return etl::move(*
this);
505 ETL_CONSTEXPR
bool is_left() const ETL_NOEXCEPT
507 return left_justified_;
516 left_justified_ =
false;
524 left_justified_ =
false;
525 return etl::move(*
this);
534 return !left_justified_;
552 return etl::move(*
this);
569 return (lhs.base_ == rhs.base_) && (lhs.width_ == rhs.width_) && (lhs.precision_ == rhs.precision_) && (lhs.upper_case_ == rhs.upper_case_)
570 && (lhs.left_justified_ == rhs.left_justified_) && (lhs.boolalpha_ == rhs.boolalpha_) && (lhs.show_base_ == rhs.show_base_)
571 && (lhs.fill_ == rhs.fill_);
579 return !(lhs == rhs);
585 uint_least8_t width_;
586 uint_least8_t precision_;
588 bool left_justified_;
591 typename TString::value_type fill_;
bitset_ext
Definition absolute.h:40