]> git.lyx.org Git - features.git/blobdiff - src/lastfiles.h
make doc++ able to generate the source documentation for lyx
[features.git] / src / lastfiles.h
index 8f095fac1c50df1847eacf1196872dc91ca54862..6e9bd81fab5d701a1d3810957ac25089c63774eb 100644 (file)
 #include <deque>
 
 #include "LString.h"
+#include "support/utility.hpp"
 
-/** The latest documents loaded
+/** The latest documents loaded.
     This class takes care of the last .lyx files used by the LyX user. It
     both reads and writes this information to a file. The number of files
     kept are user defined, but defaults to four.
+    @author Lars Gullik Bjønnes
 */
-class LastFiles {
+class LastFiles : public noncopyable {
 public:
        ///
        typedef std::deque<string> Files;
@@ -33,26 +35,22 @@ public:
        ///
        typedef Files::const_iterator const_iterator;
        
-       /**@name Constructors and Deconstructors */
-       //@{
-       /**
-          Parameters are: name of file to read. Whether LastFiles should
-          check for file existance, and the number of files to remember.
+       /** Read the lastfiles file.
+          @param file The file to read the lastfiles form.
+          @param dostat Whether to check for file existance.
+          @param num number of files to remember.
        */
        explicit
-       LastFiles(string const &,
+       LastFiles(string const & file,
                  bool dostat = true, unsigned int num = 4);
-       //@}
        
-       /**@name Methods */
-       //@{
        /**
           This funtion inserts #file# into the last files list. If the file
           already exist it is moved to the top of the list, else exist it
           is placed on the top of the list. If the list is full the last
           file in the list is popped from the end.
        */
-       void newFile(string const &);
+       void newFile(string const & file);
        /**  Writes the lastfiles table to disk. One file on each line, this
             way we can at least have some special chars (e.g. space), but
             newline in filenames are thus not allowed.
@@ -64,14 +62,16 @@ public:
        Files::const_iterator begin() const { return files.begin(); }
        ///
        Files::const_iterator end() const { return files.end(); }
-       //@}
 private:
-       /**@name const variables */
-       //@{
-       enum {
-               ///
+       /** Local constants.
+           It is more portable among different C++ compilers to use
+           an enum instead of #int const XXX#
+       */
+       enum local_constants {
+               /// Default number of lastfiles.
                DEFAULTFILES = 4,
-               /** There is no point in keeping more than this number
+               /** Max number of lastfiles.
+                   There is no point in keeping more than this number
                    of files at the same time. However perhaps someday
                    someone finds use for more files and wants to
                    change it. Please do. But don't show the files in
@@ -79,21 +79,16 @@ private:
                */
                ABSOLUTEMAXLASTFILES = 20
        };
-       //@}
        
-       /**@name Variables */
-       //@{
        /// a list of lastfiles
        Files files;
        /// number of files in the lastfiles list.
        unsigned int num_files;
        /// check for file existance or not.
        bool dostat;
-       //@}
        
-       /**@name Methods */
-       //@{
-       /** reads the .lyx_lastfiles at the beginning of the LyX session.
+       /** Read the lastfiles file.
+           Reads the .lyx_lastfiles at the beginning of the LyX session.
            This will read the lastfiles file (usually .lyx_lastfiles). It
            will normally discard files that don't exist anymore, unless
            LastFiles has been initialized with dostat = false. 
@@ -101,6 +96,5 @@ private:
        void readFile(string const &);
        /// used by the constructor to set the number of stored last files.
         void setNumberOfFiles(unsigned int num);
-       //@}
 };
 #endif