- /**@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. If it don't
- exist it is placed on the top of the list. If the list already is
- full the last visited file in the list is puched out and deleted.
- */
- void newFile(LString const &);
- /** Writes the lastfiles table to disk. A " is placed around the
- filenames to preserve special chars. (not all are preserved
- anyway, but at least space is.)
- */
- void writeFile(LString const &) const;
- //@}
+ ///
+ typedef Files::const_iterator const_iterator;
+
+ /** 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 & file,
+ bool dostat = true, unsigned int num = 4);
+
+ /** Insert #file# into the list.
+ 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.
+ @param file the file to insert in the list.
+ */
+ void newFile(string const & file);
+ /** Writes the lastfiles table to disk.
+ Writes 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.
+ @param file the file we write the lastfiles list to.
+ */
+ void writeFile(string const & file) const;
+ /** Return file #n# in the lastfiles list.
+ @param n number in the list to get
+ */
+ string const operator[](unsigned int n) const;
+ /// Iterator to the beginning of the list.
+ Files::const_iterator begin() const { return files.begin(); }
+ /// Iterator to the end of the list.
+ Files::const_iterator end() const { return files.end(); }