aboutsummaryrefslogtreecommitdiff
path: root/src/GlobalCache.cpp
blob: e627a33a27ea97c78fc4422406f78dcd4bfe9fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "../include/GlobalCache.hpp"
#include "../include/GtkGif.hpp"

namespace dchat
{
    static Cache *cache = nullptr;
    Cache& getGlobalCache()
    {
        if(!cache)
        {
            cache = new Cache([](StringView fileContent)
            {
                return new GtkGif(fileContent);
            });
        }
        return *cache;
    }
}