| 16 | namespace toft { |
| 17 | |
| 18 | const char* FormatSpecification::LengthToString() const |
| 19 | { |
| 20 | switch (length) { |
| 21 | case 0: return ""; |
| 22 | case 'h': return "h"; |
| 23 | case 'l': return "l"; |
| 24 | case 'L': return "L"; |
| 25 | case 'j': return "j"; |
| 26 | case 'z': return "t"; |
| 27 | case 't': return "t"; |
| 28 | case kFormatLengthHH: |
| 29 | return "hh"; |
| 30 | case kFormatLengthLL: |
| 31 | return "ll"; |
| 32 | } |
| 33 | |
| 34 | DCHECK(false) << "Invalid length: " << static_cast<char>(length); |
| 35 | return NULL; |
| 36 | } |
| 37 | |
| 38 | static int ParseWidth(const char* format, int* width) |
| 39 | { |