本文整理汇总了C++中PosibErr类的典型用法代码示例。如果您正苦于以下问题:C++ PosibErr类的具体用法?C++ PosibErr怎么用?C++ PosibErr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PosibErr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aspell_config_remove
extern "C" int aspell_config_remove(Config * ths, const char * key)
{
PosibErr<void> ret = ths->remove(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}
示例2: aspell_config_keyinfo
extern "C" const KeyInfo * aspell_config_keyinfo(Config * ths, const char * key)
{
PosibErr<const KeyInfo *> ret = ths->keyinfo(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return ret.data;
}
示例3: aspell_config_replace
extern "C" ASPELL_EXPORT int aspell_config_replace(Config * ths, const char * key, const char * value)
{
PosibErr<void> ret = ths->replace(key, value);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}
示例4: aspell_speller_save_all_word_lists
extern "C" ASPELL_EXPORT int aspell_speller_save_all_word_lists(Speller * ths)
{
PosibErr<void> ret = ths->save_all_word_lists();
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}
示例5: aspell_speller_clear_session
extern "C" ASPELL_EXPORT int aspell_speller_clear_session(Speller * ths)
{
PosibErr<void> ret = ths->clear_session();
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}
示例6: aspell_config_retrieve_bool
extern "C" ASPELL_EXPORT int aspell_config_retrieve_bool(Config * ths, const char * key)
{
PosibErr<bool> ret = ths->retrieve_bool(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return -1;
return ret.data;
}
示例7: aspell_config_retrieve_list
extern "C" int aspell_config_retrieve_list(Config * ths, const char * key, MutableContainer * lst)
{
PosibErr<void> ret = ths->retrieve_list(key, lst);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}
示例8: aspell_config_retrieve_int
extern "C" int aspell_config_retrieve_int(Config * ths, const char * key)
{
PosibErr<unsigned int> ret = ths->retrieve_int(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return -1;
return ret.data;
}
示例9: aspell_config_retrieve
extern "C" const char * aspell_config_retrieve(Config * ths, const char * key)
{
PosibErr<String> ret = ths->retrieve(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
ths->temp_str = ret.data;
return ths->temp_str.c_str();
}
示例10: aspell_config_get_default
extern "C" ASPELL_EXPORT const char * aspell_config_get_default(Config * ths, const char * key)
{
PosibErr<String> ret = ths->get_default(key);
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
ths->temp_str = ret.data;
return ths->temp_str.c_str();
}
示例11: aspell_speller_personal_word_list
extern "C" ASPELL_EXPORT const WordList * aspell_speller_personal_word_list(Speller * ths)
{
PosibErr<const WordList *> ret = ths->personal_word_list();
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
if (ret.data)
const_cast<WordList *>(ret.data)->from_internal_ = ths->from_internal_;
return ret.data;
}
示例12: setup
PosibErr<void> setup(const Config & c, ParmStr from, ParmStr to, Normalize norm)
{
delete conv;
conv = 0;
PosibErr<Convert *> pe = new_convert_if_needed(c, from, to, norm);
if (pe.has_err()) return pe;
conv = pe.data;
return no_err;
}
示例13: new_aspell_speller
extern "C" ASPELL_EXPORT CanHaveError * new_aspell_speller(Config * config)
{
PosibErr<Speller *> ret = new_speller(config);
if (ret.has_err()) {
return new CanHaveError(ret.release_err());
} else {
return ret;
}
}
示例14: setup
PosibErr<void> setup(CachePtr<Data> & res,
GlobalCache<Data> * cache,
typename Data::CacheConfig * config,
const typename Data::CacheKey & key) {
PosibErr<Data *> pe = get_cache_data(cache, config, key);
if (pe.has_err()) return pe;
res.reset(pe.data);
return no_err;
}
示例15: aspell_speller_add_to_session
extern "C" ASPELL_EXPORT int aspell_speller_add_to_session(Speller * ths, const char * word, int word_size)
{
ths->temp_str_0.clear();
ths->to_internal_->convert(word, word_size, ths->temp_str_0);
unsigned int s0 = ths->temp_str_0.size();
PosibErr<void> ret = ths->add_to_session(MutableString(ths->temp_str_0.mstr(), s0));
ths->err_.reset(ret.release_err());
if (ths->err_ != 0) return 0;
return 1;
}