Newer
Older
#include "DictHolder.hpp"
#include "fmt/core.h"
DictHolder::DictHolder()
{
dict.reset(new Dict(Dict::State::Open));
}
std::string DictHolder::filename() const
{
return fmt::format(filenameTemplate, getName());
}
void DictHolder::saveDict(std::filesystem::path path)
{
dict->save(path / filename(), Dict::Encoding::Ascii);
}
void DictHolder::loadDict(std::filesystem::path path)
{
Franck Dary
committed
dict.reset(new Dict((path / filename()).c_str(), dict->getState()));
}
Dict & DictHolder::getDict()
{
return *dict;
}