]> git.lyx.org Git - lyx.git/blob - src/DepTable.h
f19599962933c6726e1296ef0a3af6c9b408705e
[lyx.git] / src / DepTable.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *           Copyright 1995 Matthias Ettrich
7  *           Copyright 1995-2000 The LyX Team.
8  *        
9  *           This file is Copyright 1996-2000
10  *           Lars Gullik Bjønnes
11  *
12  * ====================================================== 
13  */
14
15 #ifndef DEP_TABLE_H
16 #define DEP_TABLE_H
17
18 #include "LString.h"
19 #include <map>
20 using std::map;
21 using std::pair;
22
23 #ifdef __GNUG__
24 #pragma interface
25 #endif
26
27 ///
28 class DepTable {
29 public:
30         /** This one is a little bit harder since we need the absolute
31           filename. Should we insert files with .sty .cls etc as
32           extension? */
33         void insert(string const & f,
34                     bool upd = false,
35                     unsigned long one = 0,
36                     unsigned long two = 0);
37         ///
38         void update();
39
40         ///
41         void write(string const & f) const;
42         ///
43         void read(string const & f);
44         /// returns true if any of the files has changed
45         bool sumchange() const;
46         /// return true if fil has changed.
47         bool haschanged(string const & fil) const;
48         /// return true if a file with extension ext has changed.
49         bool extchanged(string const & ext) const;
50         ///
51         bool exist(string const & fil) const;
52         ///
53         void remove_files_with_extension(string const &);
54 private:
55         ///
56         typedef map<string, pair<unsigned long, unsigned long> > DepList;
57         ///
58         DepList deplist;
59 };
60
61 #endif