]> git.lyx.org Git - lyx.git/blob - src/DepTable.h
Add In nsetOld * argument to updateInset to rebreak the correct par.
[lyx.git] / src / DepTable.h
1 // -*- C++ -*-
2 /**
3  * \file DepTable.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef DEP_TABLE_H
14 #define DEP_TABLE_H
15
16 #include "LString.h"
17 #include <map>
18
19 ///
20 class DepTable {
21 public:
22         /** This one is a little bit harder since we need the absolute
23           filename. Should we insert files with .sty .cls etc as
24           extension? */
25         void insert(string const & f, bool upd = false);
26         ///
27         void update();
28
29         ///
30         void write(string const & f) const;
31         /// returns true if dep file was read successfully
32         bool read(string const & f);
33         /// returns true if any of the files has changed
34         bool sumchange() const;
35         /// return true if fil has changed.
36         bool haschanged(string const & fil) const;
37         /// return true if a file with extension ext has changed.
38         bool extchanged(string const & ext) const;
39         ///
40         bool exist(string const & fil) const;
41         /// returns true if any files with ext exist
42         bool ext_exist(string const & ext) const;
43         ///
44         void remove_files_with_extension(string const &);
45         ///
46         void remove_file(string const &);
47 private:
48         ///
49         struct dep_info {
50                 /// Previously calculated CRC value
51                 unsigned long crc_prev;
52                 /// Current CRC value - only re-computed if mtime has changed.
53                 unsigned long crc_cur;
54                 /// mtime from last time current CRC was calculated.
55                 long mtime_cur;
56                 ///
57                 bool changed() const;
58         };
59         ///
60         typedef std::map<string, dep_info> DepList;
61         ///
62         DepList deplist;
63 };
64
65 #endif