165 {
166 char buf[68];
167 char* p = buf + sizeof(buf);
168 *--p = '\0';
169
170 bool negative = false;
172 UnsignedT uval;
173
175 negative = true;
176 uval =
static_cast<UnsignedT
>(-(
value + 1)) + 1;
177 } else {
178 uval =
static_cast<UnsignedT
>(
value);
179 }
180
181 char type = spec.
type ? spec.
type :
'd';
182 int base = 10;
183 const char*
digits =
"0123456789abcdef";
184
185 switch (type) {
186 case 'b': case 'B': base = 2; break;
187 case 'o': base = 8; break;
188 case 'x': base = 16;
digits =
"0123456789abcdef";
break;
189 case 'X': base = 16;
digits =
"0123456789ABCDEF";
break;
190 case 'c': {
191
192 char ch =
static_cast<char>(
value);
194 }
195 default: base = 10; break;
196 }
197
198
199 if (uval == 0) {
200 *--p = '0';
201 } else {
202 while (uval > 0) {
203 *--p =
digits[uval % base];
204 uval /= base;
205 }
206 }
207
208
209 fl::string prefix;
210 if (negative) {
212 }
else if (spec.
sign ==
'+') {
214 }
else if (spec.
sign ==
' ') {
216 }
217
219 if (base == 16) {
222 } else if (base == 2) {
225 } else if (base == 8 && *p != '0') {
227 }
228 }
229
230 fl::string num_str(p);
231
232
234 int num_width = spec.
width -
static_cast<int>(prefix.
size());
235 if (num_width > static_cast<int>(num_str.size())) {
236 fl::string padded;
237 for (int i = 0; i < num_width - static_cast<int>(num_str.size()); ++i) {
239 }
241 return fl::string(prefix) += padded;
242 }
243 }
244
245 return fl::string(prefix) += num_str;
246}
fl::size size() const FL_NOEXCEPT
string & append(const bitset_fixed< N > &bs) FL_NOEXCEPT
constexpr int type_rank< T >::value
constexpr int numeric_limits< char >::digits