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