A C++ wrapper for the basic C datatypes defined by the pEpEngine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
874 B

#include "bloblist.hh"
#include <pEp/bloblist.h>
namespace pEp
{
template<>
void Wrapper<::bloblist_t*>::_free(::bloblist_t* bl)
{
::free_bloblist(bl);
}
template<>
int BlobList::size() const
{
return bloblist_length(value);
}
// faster than .size()==0 because it's not necessary to iterate throgh the whole list
template<>
bool BlobList::empty() const
{
return !(value && value->value);
}
template<>
void BlobList::clear()
{
free_bloblist(value);
value = nullptr;
}
template<>
void BlobList::push_back(const char*&& s)
{
auto last = stringlist_add(value, s);
if(value==nullptr)
value = last;
}
////////////////
template class ListWrapper<::bloblist_t*, ::bloblist_t*>;
} // end of namespace pEp