lib/mu-store: rework implementation

* mu-store.h, mu-store-read.cc, mu-store-write.cc, mu-store-priv.hh have been reworked
   in mu-store.{cc,hh}, it the mix of c/c++ improved
 * update all the dependent modules
 * make it easier to upgrade an database in place (without user intervention)
 * remove the xbatch-size option
This commit is contained in:
Dirk-Jan C. Binnema
2019-07-28 14:12:06 +03:00
parent b7cda29b96
commit 83d6484f86
14 changed files with 1393 additions and 1947 deletions

View File

@ -71,11 +71,11 @@ struct ContactInfo {
class Contacts {
public:
/**
* Construct a new contacts object
* Construct a new contacts objects
*
* @param serialized serialized contacts
*/
Contacts (const std::string& serialized);
Contacts (const std::string& serialized = "");
/**
* DTOR
@ -147,7 +147,9 @@ public:
*
* @return a MuContacts* refering to this.
*/
MuContacts* mu_contacts() { return reinterpret_cast<MuContacts*>(this); }
const MuContacts* mu_contacts() const {
return reinterpret_cast<const MuContacts*>(this);
}
@ -170,7 +172,7 @@ G_BEGIN_DECLS
*
* @return the number of contacts
*/
size_t mu_contacts_count (MuContacts *self);
size_t mu_contacts_count (const MuContacts *self);
/**
* Function called for mu_contacts_foreach; returns the e-mail address, name
@ -196,7 +198,7 @@ typedef void (*MuContactsForeachFunc) (const char *full_address,
* @return TRUE if the function succeeded, or FALSE if the provide regular
* expression was invalid (and not NULL)
*/
gboolean mu_contacts_foreach (MuContacts *self,
gboolean mu_contacts_foreach (const MuContacts *self,
MuContactsForeachFunc func,
gpointer user_data);