forked from OctaForge/libostd
formatting
This commit is contained in:
parent
d259877fba
commit
7a11157f95
|
@ -14,12 +14,12 @@ struct Foo {
|
|||
template<typename R>
|
||||
bool to_format(Foo const &, R &writer, FormatSpec const &fs) {
|
||||
switch (fs.spec()) {
|
||||
case 'i':
|
||||
writer.put_string("Foo1");
|
||||
break;
|
||||
default:
|
||||
writer.put_string("Foo2");
|
||||
break;
|
||||
case 'i':
|
||||
writer.put_string("Foo1");
|
||||
break;
|
||||
default:
|
||||
writer.put_string("Foo2");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -29,12 +29,12 @@ struct Bar {
|
|||
template<typename R>
|
||||
bool to_format(R &writer, FormatSpec const &fs) const {
|
||||
switch (fs.spec()) {
|
||||
case 'i':
|
||||
writer.put_string("Bar1");
|
||||
break;
|
||||
default:
|
||||
writer.put_string("Bar2");
|
||||
break;
|
||||
case 'i':
|
||||
writer.put_string("Bar1");
|
||||
break;
|
||||
default:
|
||||
writer.put_string("Bar2");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@ namespace detail {
|
|||
inline int parse_fmt_flags(ConstCharRange &fmt, int ret) {
|
||||
while (!fmt.empty()) {
|
||||
switch (fmt.front()) {
|
||||
case '-': ret |= FMT_FLAG_DASH; fmt.pop_front(); break;
|
||||
case '+': ret |= FMT_FLAG_PLUS; fmt.pop_front(); break;
|
||||
case '#': ret |= FMT_FLAG_HASH; fmt.pop_front(); break;
|
||||
case '0': ret |= FMT_FLAG_ZERO; fmt.pop_front(); break;
|
||||
case ' ': ret |= FMT_FLAG_SPACE; fmt.pop_front(); break;
|
||||
default: goto retflags;
|
||||
case '-': ret |= FMT_FLAG_DASH; fmt.pop_front(); break;
|
||||
case '+': ret |= FMT_FLAG_PLUS; fmt.pop_front(); break;
|
||||
case '#': ret |= FMT_FLAG_HASH; fmt.pop_front(); break;
|
||||
case '0': ret |= FMT_FLAG_ZERO; fmt.pop_front(); break;
|
||||
case ' ': ret |= FMT_FLAG_SPACE; fmt.pop_front(); break;
|
||||
default: goto retflags;
|
||||
}
|
||||
}
|
||||
retflags:
|
||||
|
|
Loading…
Reference in a new issue