Implement runtime precision.

This commit is contained in:
Victor Zverovich
2012-12-12 15:21:11 -08:00
parent db306cfb22
commit 363352754c
3 changed files with 181 additions and 46 deletions
+8
View File
@@ -244,6 +244,7 @@ class Formatter {
internal::Array<const Arg*, NUM_INLINE_ARGS> args_; // Format arguments.
const char *format_; // Format string.
int num_open_braces_;
friend class internal::ArgInserter;
@@ -251,6 +252,8 @@ class Formatter {
args_.push_back(&arg);
}
void ReportError(const char *s, const std::string &message) const;
// Formats an integer.
template <typename T>
void FormatInt(T value, unsigned flags, int width, char type);
@@ -264,6 +267,11 @@ class Formatter {
template <typename T>
void FormatCustomArg(const void *arg, int width);
unsigned ParseUInt(const char *&s) const;
// Parses argument index and returns an argument with this index.
const Arg &ParseArgIndex(const char *&s) const;
void DoFormat();
void Format() {