From 66c5cd44277863708fdc81a6418bc84215b0c269 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 21 Feb 2009 19:52:31 -0400 Subject: Use a "format accumulator" for error strings This makes it possible to internationalize strings while still using I/O streams. For example: std::cout << ACCUM(_("Hello to %1 and %2!") << "me" << "you") << std::endl; --- src/error.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/error.cc') diff --git a/src/error.cc b/src/error.cc index dbda8c30..ffcd2941 100644 --- a/src/error.cc +++ b/src/error.cc @@ -33,8 +33,10 @@ namespace ledger { -std::ostringstream _desc_buffer; +straccstream _ctxt_accum; std::ostringstream _ctxt_buffer; +straccstream _desc_accum; +std::ostringstream _desc_buffer; string error_context() { -- cgit v1.2.3