20 #ifndef HEADER_TINYGETTEXT_DICTIONARY_MANAGER_HPP 21 #define HEADER_TINYGETTEXT_DICTIONARY_MANAGER_HPP 26 #include <unordered_map> 42 typedef std::unordered_map<Language, Dictionary*, Language_hash>
Dictionaries;
std::string convertFilename2Language(const std::string &s_in) const
This function converts a .po filename (e.g.
Definition: dictionary_manager.cpp:257
Dictionary & get_dictionary()
Return the currently active dictionary, if none is set, an empty dictionary is returned.
Definition: dictionary_manager.cpp:78
DictionaryManager & operator=(const DictionaryManager &)
void set_language(const Language &language)
Set a language based on a four? letter country code.
Definition: dictionary_manager.cpp:202
std::set< Language > get_languages()
Return a set of the available languages in their country code.
Definition: dictionary_manager.cpp:182
Language current_language
Definition: dictionary_manager.hpp:51
std::unordered_map< Language, Dictionary *, Language_hash > Dictionaries
Definition: dictionary_manager.hpp:42
Lightweight wrapper around LanguageSpec.
Definition: language.hpp:31
bool get_use_fuzzy() const
Definition: dictionary_manager.cpp:232
Manager class for dictionaries, you give it a bunch of directories with .po files and it will then au...
Definition: dictionary_manager.hpp:39
void set_use_fuzzy(bool t)
Definition: dictionary_manager.cpp:225
SearchPath search_path
Definition: dictionary_manager.hpp:46
void set_charset(const std::string &charset)
Set a charset that will be set on the returned dictionaries.
Definition: dictionary_manager.cpp:218
Language get_language() const
returns the (normalized) country code of the currently used language
Definition: dictionary_manager.cpp:212
void add_directory(const std::string &pathname)
Add a directory to the search path for dictionaries, earlier added directories have higher priority t...
Definition: dictionary_manager.cpp:238
Dictionaries dictionaries
Definition: dictionary_manager.hpp:43
Definition: dictionary.hpp:29
DictionaryManager(const std::string &charset_="UTF-8")
Definition: dictionary_manager.cpp:45
std::vector< std::string > SearchPath
Definition: dictionary_manager.hpp:45
A simple dictionary class that mimics gettext() behaviour.
Definition: dictionary.hpp:34
void set_filesystem(std::unique_ptr< FileSystem > filesystem)
Definition: dictionary_manager.cpp:245
~DictionaryManager()
Definition: dictionary_manager.cpp:57
bool use_fuzzy
Definition: dictionary_manager.hpp:49
Dictionary empty_dict
Definition: dictionary_manager.hpp:54
std::string charset
Definition: dictionary_manager.hpp:48
Dictionary * current_dict
Definition: dictionary_manager.hpp:52
std::unique_ptr< FileSystem > filesystem
Definition: dictionary_manager.hpp:56
void clear_cache()
Definition: dictionary_manager.cpp:66