|
|
|
@ -65,10 +65,59 @@ namespace pEp
|
|
|
|
|
{
|
|
|
|
|
free_stringpair(sp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void Wrapper<::stringpair_list_t*>::_free(::stringpair_list_t* spl)
|
|
|
|
|
{
|
|
|
|
|
free_stringpair_list(spl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
stringpair_t* stringpair_list_t::* const ListWrapper<stringpair_list_t*, stringpair_t*>::Value = &stringpair_list_t::value;
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
int StringPairList::size() const
|
|
|
|
|
{
|
|
|
|
|
return stringpair_list_length(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// faster than .size()==0 because it's not necessary to iterate throgh the whole list
|
|
|
|
|
template<>
|
|
|
|
|
bool StringPairList::empty() const
|
|
|
|
|
{
|
|
|
|
|
return value && value->value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void StringPairList::erase( const StringPairList::iterator& it)
|
|
|
|
|
{
|
|
|
|
|
if(it.value && it.value->value && it.value->value->key)
|
|
|
|
|
{
|
|
|
|
|
value = stringpair_list_delete_by_key(value, it.value->value->key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void StringPairList::clear()
|
|
|
|
|
{
|
|
|
|
|
free_stringpair_list(value);
|
|
|
|
|
value = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void StringPairList::push_back(::stringpair_t*&& sp)
|
|
|
|
|
{
|
|
|
|
|
stringpair_list_add(value, sp);
|
|
|
|
|
sp = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
void StringPairList::push_back(StringPair&& sp)
|
|
|
|
|
{
|
|
|
|
|
stringpair_list_add(value, sp.move_out());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////
|
|
|
|
|
|
|
|
|
|
template class Wrapper<::pEp_identity>;
|
|
|
|
|