X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FConverterCache.h;h=72afe293e5ae515a287d6952534a15bde6762396;hb=4ed0312c51704780af1c452d3a82a84171b3725a;hp=665f32d285401425b877a82bd2f0ff5c1c690e93;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/ConverterCache.h b/src/ConverterCache.h index 665f32d285..72afe293e5 100644 --- a/src/ConverterCache.h +++ b/src/ConverterCache.h @@ -10,21 +10,18 @@ * * Full author contact details are available in file CREDITS. * - * lyx::ConverterCache is the manager of the file cache. - * It is responsible for creating the lyx::ConverterCacheItem's + * ConverterCache is the manager of the file cache. + * It is responsible for creating the ConverterCacheItem's * and maintaining them. * - * lyx::ConverterCache is a singleton class. It is possible to have + * ConverterCache is a singleton class. It is possible to have * only one instance of it at any moment. */ #ifndef CONVERTERCACHE_H #define CONVERTERCACHE_H -#include -#include - -#include +#include "support/strfwd.h" namespace lyx { @@ -49,7 +46,7 @@ namespace support { class FileName; } * * There is no cache maintenance yet (max size, max age etc.) */ -class ConverterCache : boost::noncopyable { +class ConverterCache { public: /// This is a singleton class. Get the instance. @@ -58,33 +55,44 @@ public: /// Init the cache. This must be done after package initialization. static void init(); + /// Writes the index list. This must be called on exit. + void writeIndex() const; + /** * Add \c converted_file (\c orig_from converted to \c to_format) to * the cache if it is not already in or not up to date. */ void add(support::FileName const & orig_from, std::string const & to_format, - support::FileName const & converted_file) const; + support::FileName const & converted_file) const; /// Remove a file from the cache. void remove(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; + + /// Remove all cached \p from_format -> \p to_format conversions + void remove_all(std::string const & from_format, + std::string const & to_format) const; /** * Returns \c true if \c orig_from converted to \c to_format is in * the cache and up to date. */ bool inCache(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; /// Get the name of the cached file support::FileName const & cacheName(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; /// Copy the file from the cache to \p dest bool copy(support::FileName const & orig_from, std::string const & to_format, - support::FileName const & dest) const; + support::FileName const & dest) const; private: + /// noncopyable + ConverterCache(ConverterCache const &); + void operator=(ConverterCache const &); + /** Make the c-tor, d-tor private so we can control how many objects * are instantiated. */ @@ -95,7 +103,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace lyx