summaryrefslogtreecommitdiff
path: root/src/error.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-05-14 21:36:42 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-05-14 21:44:00 -0600
commitf4f3058b8cd75c04080f9b68cb54b9584eafb39f (patch)
treeeca9ca6ceca001209fb93c05b52e21031280d18c /src/error.h
parent96172669053bbba7263a370f109f70615049a0c6 (diff)
downloadfork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.tar.gz
fork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.tar.bz2
fork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.zip
Switch to using Boost.Format
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/error.h b/src/error.h
index 86d9de76..9837fa4d 100644
--- a/src/error.h
+++ b/src/error.h
@@ -42,11 +42,8 @@
#ifndef _ERROR_H
#define _ERROR_H
-#include "accum.h"
-
namespace ledger {
-extern straccstream _desc_accum;
extern std::ostringstream _desc_buffer;
template <typename T>
@@ -57,8 +54,7 @@ inline void throw_func(const string& message) {
}
#define throw_(cls, msg) \
- ((_desc_buffer << ACCUM(_desc_accum << msg)), \
- _desc_accum.clear(), \
+ ((_desc_buffer << (msg)), \
throw_func<cls>(_desc_buffer.str()))
inline void warning_func(const string& message) {
@@ -68,19 +64,15 @@ inline void warning_func(const string& message) {
}
#define warning_(msg) \
- ((_desc_buffer << ACCUM(_desc_accum << msg)), \
- _desc_accum.clear(), \
+ ((_desc_buffer << (msg)), \
warning_func(_desc_buffer.str()))
-extern straccstream _ctxt_accum;
extern std::ostringstream _ctxt_buffer;
-#define add_error_context(msg) \
- ((long(_ctxt_buffer.tellp()) == 0) ? \
- ((_ctxt_buffer << ACCUM(_ctxt_accum << msg)), \
- _ctxt_accum.clear()) : \
- ((_ctxt_buffer << std::endl << ACCUM(_ctxt_accum << msg)), \
- _ctxt_accum.clear()))
+#define add_error_context(msg) \
+ ((long(_ctxt_buffer.tellp()) == 0) ? \
+ (_ctxt_buffer << (msg)) : \
+ (_ctxt_buffer << std::endl << (msg)))
string error_context();