diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
commit | 944e580825f0d9ce060b6dcdffe8990b6c2cca20 (patch) | |
tree | e2651b0df622d9b8d3831f35743e7dbd31c16897 /src/accum.h | |
parent | e2afc783db0dff1927b00dc506390353d9e3bbd2 (diff) | |
download | fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.gz fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.bz2 fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.zip |
Refactored the notion of "the current parsing context"
Diffstat (limited to 'src/accum.h')
-rw-r--r-- | src/accum.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/accum.h b/src/accum.h index 349aeba9..dde93c30 100644 --- a/src/accum.h +++ b/src/accum.h @@ -86,10 +86,16 @@ public: extern straccstream _accum; extern std::ostringstream _accum_buffer; +inline string str_helper_func() { + string buf = _accum_buffer.str(); + _accum_buffer.clear(); + _accum_buffer.str(""); + return buf; +} + #define STR(msg) \ ((_accum_buffer << ACCUM(_accum << msg)), \ - _accum.clear(), \ - _accum_buffer.str()) + _accum.clear(), str_helper_func()) } // namespace ledger |