diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-29 22:11:55 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-29 22:11:55 -0600 |
commit | 8013e091292628b3e631fea07342c31f1c36966b (patch) | |
tree | 6e3e804c4fba3a416dfa79a890f25381032b8552 /src/accum.h | |
parent | eac84f5e2184cabad709fbb165d58d0b17f791d0 (diff) | |
download | fork-ledger-8013e091292628b3e631fea07342c31f1c36966b.tar.gz fork-ledger-8013e091292628b3e631fea07342c31f1c36966b.tar.bz2 fork-ledger-8013e091292628b3e631fea07342c31f1c36966b.zip |
Added STR() utility function
Diffstat (limited to 'src/accum.h')
-rw-r--r-- | src/accum.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/accum.h b/src/accum.h index 236a7714..411bcbe6 100644 --- a/src/accum.h +++ b/src/accum.h @@ -83,6 +83,14 @@ public: #define ACCUM(obj) (static_cast<const straccstream&>(obj).str()) +extern straccstream _accum; +extern std::ostringstream _accum_buffer; + +#define STR(msg) \ + ((_accum_buffer << ACCUM(_accum << msg)), \ + _accum.clear(), \ + _accum_buffer.str()) + } // namespace ledger #endif // _ACCUM_H |