26#if ! defined (octave_pager_h)
27#define octave_pager_h 1
29#include "octave-config.h"
44class OCTINTERP_API
pager_buf :
public std::stringbuf
48 pager_buf () : std::stringbuf (), m_diary_skip (0) { }
54 void flush_current_contents_to_diary ();
56 void set_diary_skip ();
64 std::size_t m_diary_skip;
77 void flush_current_contents_to_diary ();
79 void set_diary_skip ();
90class OCTINTERP_API
diary_buf :
public std::stringbuf
94 OCTAVE_DEFAULT_CONSTRUCT_DELETE (
diary_buf)
141 std::string val = m_diary_file_name;
142 m_diary_file_name = nm.empty () ?
"diary" : nm;
148 std::string
PAGER ()
const {
return m_PAGER; }
150 std::string
PAGER (
const std::string& s)
152 std::string val = m_PAGER;
163 std::string val = m_PAGER_FLAGS;
173 return m_page_output_immediately;
178 bool val = m_page_output_immediately;
179 m_page_output_immediately = flag;
190 bool val = m_page_screen_output;
191 m_page_screen_output = flag;
197 return m_write_to_diary_file;
202 bool val = m_write_to_diary_file;
203 m_write_to_diary_file = flag;
209 return m_really_flush_to_pager;
214 bool val = m_really_flush_to_pager;
215 m_really_flush_to_pager = flag;
221 return m_flushing_output_to_pager;
226 bool val = m_flushing_output_to_pager;
227 m_flushing_output_to_pager = flag;
239 bool sync (
const char *msg,
int len);
263 std::ofstream m_external_diary_file;
266 std::string m_diary_file_name;
272 std::string m_PAGER_FLAGS;
277 bool m_page_output_immediately;
281 bool m_page_screen_output;
284 bool m_write_to_diary_file;
286 bool m_really_flush_to_pager;
288 bool m_flushing_output_to_pager;
290 void start_external_pager ();
292 void do_sync (
const char *msg,
int len,
bool bypass_pager);
295extern OCTINTERP_API std::ostream&
__stdout__ ();
297extern OCTINTERP_API std::ostream&
__diary__ ();
299OCTAVE_END_NAMESPACE(octave)
301#define octave_stdout (octave::__stdout__ ())
303#define octave_diary (octave::__diary__ ())
bool page_output_immediately(bool flag)
std::string PAGER_FLAGS() const
bool page_screen_output() const
bool page_output_immediately() const
bool flushing_output_to_pager(bool flag)
std::string diary_file_name() const
std::ofstream & external_diary_file()
std::ostream & __stdout__()
bool write_to_diary_file(bool flag)
std::string PAGER(const std::string &s)
bool really_flush_to_pager(bool flag)
bool sync(const char *msg, int len)
bool flushing_output_to_pager() const
void clear_external_pager()
bool really_flush_to_pager() const
std::ostream & __diary__()
std::string diary_file_name(const std::string &nm)
bool write_to_diary_file() const
std::string pager_command() const
std::string PAGER_FLAGS(const std::string &s)
bool page_screen_output(bool flag)
std::string PAGER() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn