diff liboctave/cmd-hist.h @ 11368:944b7e20fc5a

improve handling of exceptions for startup files
author John W. Eaton <jwe@octave.org>
date Wed, 15 Dec 2010 02:05:27 -0500
parents cbc402e64d83
children a1deab9a6e71
line wrap: on
line diff
--- a/liboctave/cmd-hist.h	Wed Dec 15 00:44:10 2010 -0500
+++ b/liboctave/cmd-hist.h	Wed Dec 15 02:05:27 2010 -0500
@@ -34,13 +34,17 @@
 protected:
 
   command_history (void)
-    : ignoring_additions (false), lines_in_file (0),
+    : initialized (false), ignoring_additions (false), lines_in_file (0),
       lines_this_session (0), xfile (), xsize (-1) { }
 
 public:
 
   virtual ~command_history (void) { }
 
+  static void initialize (bool, const std::string&, int);
+
+  static bool is_initialized (void);
+
   static void set_file (const std::string&);
 
   static std::string file (void);
@@ -128,6 +132,10 @@
 
   virtual std::string do_file (void);
 
+  virtual void do_initialize (bool, const std::string&, int);
+
+  virtual bool do_is_initialized (void) const;
+
   virtual void do_set_size (int);
 
   virtual int do_size (void);
@@ -182,6 +190,10 @@
 
   void error (const std::string&);
 
+  // TRUE means we have initialized the history file name and number of
+  // lines to save.
+  bool initialized;
+
   // TRUE means we are ignoring new additions.
   bool ignoring_additions;