Debian Codegraph @

src/cache.h

raw symbols SCIP
1 /***************************************************************************
2 * Copyright (C) 2016 by Christian Dietrich *
3 * [email protected] *
4 * Copyright (C) 2017-2023 by Hans-Peter Deifel <[email protected]> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
19 * Boston, MA 02110-1301 USA. *
20 ***************************************************************************/
21
22 #ifndef CACHE_H
23 #define CACHE_H
24
25 #include <vector>
26 #include <string>
27
28 struct CachePage {
29 std::string text;
30 std::string label;
31 };
32
33 class Cache {
34 std::vector<CachePage> pages;
35 std::string cache_file;
36 bool valid;
37 public:
38 explicit Cache(std::string const& cache_file);
39
40 bool get_page(unsigned pagenum, CachePage& text);
41 void set_page(unsigned pagenum, const CachePage& page);
42
43 void dump();
44 };
45
46 void limit_cachesize(const char *cache, int entries);
47
48 /** Write cache directory to dir.
49 *
50 * Returns -1 on failure and 0 on success
51 */
52 int find_cache_directory(std::string &dir);
53
54 #endif
55
56 /* Local Variables: */
57 /* mode: c++ */
58 /* End: */