Mercurial > hg > octave-nkf
annotate src/pager.h @ 10785:c2041adcf234
remove unnecessary sparse indexing overloads
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 13 Jul 2010 12:08:08 +0200 |
parents | 0522a65bcd56 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
1 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2002, 2005, 2006, |
9245 | 4 2007, 2009 John W. Eaton |
1 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
1 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
1 | 21 |
22 */ | |
23 | |
383 | 24 #if !defined (octave_pager_h) |
25 #define octave_pager_h 1 | |
1 | 26 |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
27 #include <iosfwd> |
5765 | 28 #include <sstream> |
1760 | 29 #include <string> |
30 | |
2095 | 31 #include <sys/types.h> |
32 | |
33 class | |
6109 | 34 OCTINTERP_API |
5765 | 35 octave_pager_buf : public std::stringbuf |
2095 | 36 { |
37 public: | |
38 | |
5765 | 39 octave_pager_buf (void) : std::stringbuf (), diary_skip (0) { } |
2095 | 40 |
3477 | 41 void flush_current_contents_to_diary (void); |
42 | |
3756 | 43 void set_diary_skip (void); |
44 | |
2095 | 45 protected: |
46 | |
47 int sync (void); | |
3756 | 48 |
49 private: | |
50 | |
51 size_t diary_skip; | |
2095 | 52 }; |
53 | |
54 class | |
6109 | 55 OCTINTERP_API |
3537 | 56 octave_pager_stream : public std::ostream |
2095 | 57 { |
58 protected: | |
59 | |
60 octave_pager_stream (void); | |
61 | |
62 public: | |
63 | |
64 ~octave_pager_stream (void); | |
65 | |
3477 | 66 void flush_current_contents_to_diary (void); |
67 | |
3756 | 68 void set_diary_skip (void); |
69 | |
2095 | 70 static octave_pager_stream& stream (void); |
71 | |
72 private: | |
73 | |
74 static octave_pager_stream *instance; | |
75 | |
76 octave_pager_buf *pb; | |
77 | |
78 // No copying! | |
79 | |
80 octave_pager_stream (const octave_pager_stream&); | |
81 | |
82 octave_pager_stream& operator = (const octave_pager_stream&); | |
83 }; | |
1 | 84 |
2095 | 85 class |
6109 | 86 OCTINTERP_API |
5765 | 87 octave_diary_buf : public std::stringbuf |
2095 | 88 { |
89 public: | |
90 | |
5765 | 91 octave_diary_buf (void) : std::stringbuf () { } |
2095 | 92 |
93 protected: | |
94 | |
95 int sync (void); | |
96 }; | |
97 | |
98 class | |
6109 | 99 OCTINTERP_API |
3537 | 100 octave_diary_stream : public std::ostream |
2095 | 101 { |
102 protected: | |
103 | |
104 octave_diary_stream (void); | |
105 | |
106 public: | |
107 | |
108 ~octave_diary_stream (void); | |
109 | |
110 static octave_diary_stream& stream (void); | |
111 | |
112 private: | |
113 | |
114 static octave_diary_stream *instance; | |
115 | |
116 octave_diary_buf *db; | |
117 | |
118 // No copying! | |
119 | |
120 octave_diary_stream (const octave_diary_stream&); | |
121 | |
122 octave_diary_stream& operator = (const octave_diary_stream&); | |
123 }; | |
124 | |
125 #define octave_stdout (octave_pager_stream::stream ()) | |
126 | |
127 #define octave_diary (octave_diary_stream::stream ()) | |
128 | |
6109 | 129 extern OCTINTERP_API void flush_octave_stdout (void); |
2095 | 130 |
1 | 131 #endif |