]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsCache.C
small changes read ChangeLog
[lyx.git] / src / graphics / GraphicsCache.C
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 Copyright 2000 Baruch Even
10  * ================================================= */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "GraphicsCache.h"
19
20
21 GraphicsCache * GraphicsCache::singleton = 0;
22
23
24 GraphicsCache * 
25 GraphicsCache::getInstance()
26 {
27     if (! singleton) {
28         singleton = new GraphicsCache;
29     }
30
31     return singleton;
32 }
33
34
35 GraphicsCache::~GraphicsCache()
36 {
37         delete singleton;
38 }
39
40
41 GraphicsCacheItem * 
42 GraphicsCache::addFile(string const & filename)
43 {
44     CacheType::const_iterator it = cache.find(filename);
45     
46     if (it != cache.end()) {
47         return (*it).second;
48     }
49     // INCOMPLETE!
50     return 0;
51 }
52
53
54 void
55 GraphicsCache::removeFile(string const & filename)
56 {
57     CacheType::const_iterator it = cache.find(filename);
58     
59     if (it != cache.end()) {
60         // INCOMPLETE!
61 //        cache.erase(it);
62     }
63 }