mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-22 16:04:07 +00:00
52 lines
998 B
C++
52 lines
998 B
C++
|
// -*- C++ -*-
|
||
|
/* This file is part of
|
||
|
* =================================================
|
||
|
*
|
||
|
* LyX, The Document Processor
|
||
|
* Copyright 1995 Matthias Ettrich.
|
||
|
* Copyright 1995-2000 The LyX Team.
|
||
|
*
|
||
|
* This file Copyright 2000 Baruch Even
|
||
|
* ================================================= */
|
||
|
|
||
|
#ifdef __GNUG__
|
||
|
#pragma implementation
|
||
|
#endif
|
||
|
|
||
|
#include <config.h>
|
||
|
#include "GraphicsCache.h"
|
||
|
|
||
|
GraphicsCache *
|
||
|
GraphicsCache::getInstance()
|
||
|
{
|
||
|
if (! singleton) {
|
||
|
singleton = new GraphicsCache;
|
||
|
}
|
||
|
|
||
|
return singleton;
|
||
|
}
|
||
|
|
||
|
|
||
|
GraphicsCacheItem *
|
||
|
GraphicsCache::addFile(string filename)
|
||
|
{
|
||
|
CacheType::const_iterator it = cache.find(filename);
|
||
|
|
||
|
if (it != cache.end()) {
|
||
|
return (*it).second;
|
||
|
}
|
||
|
// INCOMPLETE!
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
void
|
||
|
GraphicsCache::removeFile(string filename)
|
||
|
{
|
||
|
CacheType::const_iterator it = cache.find(filename);
|
||
|
|
||
|
if (it != cache.end()) {
|
||
|
// INCOMPLETE!
|
||
|
// cache.erase(it);
|
||
|
}
|
||
|
}
|