23 #include "enchant-provider.h"
37 _provider = GetProviderForTests();
40 std::string Convert(
const std::wstring & ws)
43 switch (
sizeof(
wchar_t)) {
45 str = g_utf16_to_utf8((gunichar2*)ws.c_str(), (glong)ws.length(), NULL, NULL, NULL);
48 str = g_ucs4_to_utf8((gunichar*)ws.c_str(), (glong)ws.length(), NULL, NULL, NULL);
58 std::wstring Convert(
const std::string & s)
60 gunichar2* str = g_utf8_to_utf16(s.c_str(), (glong)s.length(), NULL, NULL, NULL);
61 std::wstring ws((
wchar_t*)str);
71 char *lang = enchant_get_user_language();
72 dict = (*_provider->request_dict) (_provider, lang);
76 if (!dict && _provider->list_dicts)
80 char ** dicts = (*_provider->list_dicts) (_provider, &n_dicts);
82 dict = (*_provider->request_dict) (_provider, dicts[0]);
90 return (*_provider->request_dict) (_provider, language);
96 _provider->dispose_dict(_provider, dict);
Definition: unittest_enchant_providers.h:31
Definition: enchant-provider.h:125
Definition: enchant-provider.h:150