summaryrefslogtreecommitdiff
path: root/modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:15:18 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:15:18 +0000
commitb71531b42b3325fd6079a7039aae8641262c8adf (patch)
treea5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp
parenta0f67cc97c0050d907145e312135b60c0125e56e (diff)
downloadATCD-b71531b42b3325fd6079a7039aae8641262c8adf.tar.gz
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp')
-rw-r--r--modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp b/modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp
new file mode 100644
index 00000000000..713f917e834
--- /dev/null
+++ b/modules/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp
@@ -0,0 +1,61 @@
+// file : CCF/CodeGenerationKit/IndentationBuffer.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_CODE_GENERATION_KIT_INDENTATION_BUFFER_HPP
+#define CCF_CODE_GENERATION_KIT_INDENTATION_BUFFER_HPP
+
+#include "CCF/CompilerElements/ExH.hpp"
+
+#include <string>
+
+namespace Indentation
+{
+ template <typename C>
+ class Buffer
+ {
+ public:
+ class Exception_ {};
+ typedef
+ ExH::Compound <Exception_, ExH::Logic::DescriptiveException>
+ Exception;
+
+ class EndOfStream_ {};
+ typedef
+ ExH::Compound <EndOfStream_, Exception>
+ EndOfStream;
+
+ public:
+ virtual
+ ~Buffer () throw () {}
+
+ public:
+ typedef
+ std::char_traits<C>
+ traits_type;
+
+ typedef
+ typename traits_type::char_type
+ char_type;
+
+ typedef
+ typename traits_type::int_type
+ int_type;
+
+ public:
+ virtual int_type
+ put (char_type c) throw (Exception, ExH::System::Exception) = 0;
+
+ // Unbuffer flushes internal formatting buffers (if any).
+ // Note that unbuffer is not exactly flushing since it can
+ // result in formatting errors and in general can not be
+ // called at arbitrary points. Natural use case would be
+ // to call unbuffer at the end of the stream when no more
+ // data is expected.
+ //
+ virtual void
+ unbuffer () throw (EndOfStream, Exception, ExH::System::Exception) = 0;
+ };
+}
+
+#endif // CCF_CODE_GENERATION_KIT_INDENTATION_BUFFER_HPP