summaryrefslogtreecommitdiff
path: root/src/stream.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-06 03:31:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-06 03:31:41 -0400
commitcf6babcf9048f7e9205b1bead4794d8e2e9e8d62 (patch)
tree38688d2cd2433517045a67d2ef3f2777ee335050 /src/stream.h
parentecc5a1aab50d57e65b654ea9f8a84f17208ca612 (diff)
downloadfork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.tar.gz
fork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.tar.bz2
fork-ledger-cf6babcf9048f7e9205b1bead4794d8e2e9e8d62.zip
Restored all the option handlers from 2.6.2, but not the options themselves.
Diffstat (limited to 'src/stream.h')
-rw-r--r--src/stream.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/stream.h b/src/stream.h
index 919c801d..ddc5369a 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -61,7 +61,7 @@ namespace ledger {
* Cline's "C++ FAQ Lite". Arguably this should be three different
* classes, but that introduces additional unneeded complications.
*/
-class output_stream_t : public noncopyable
+class output_stream_t
{
private:
int pipe_to_pager_fd;
@@ -81,6 +81,16 @@ public:
}
/**
+ * When copy-constructed, make the copy just be a new output stream. This
+ * allows large classes to rely on their default copy-constructor without
+ * worrying about pointer copying within output_stream_t.
+ */
+ output_stream_t(const output_stream_t& other)
+ : pipe_to_pager_fd(-1), os(&std::cout) {
+ TRACE_CTOR(output_stream_t, "copy");
+ }
+
+ /**
* Destroys an output_stream_t. This deletes the dynamically
* allocated ostream, if necessary. It also closes output file
* descriptor, if necessary.