syncevolution/src/backends/sqlite
Patrick Ohly 2fa3c3335a C++: replace boost::shared_ptr, boost::function, boost::bind
We can use std::shared_ptr and std::function instead now.

Lambdas are usually a better alternative to boost/std::bind. The
downside is the need to explicitly specify parameters completely. When
inlining callbacks entirely with lambdas, duplication of that
parameter list can be avoided.

Whenever possible, use std::make_shared to construct objects that are
tracked by std::shared_ptr.

Some objects need a std::weak_ptr during object destruction. For that
we have to use our own implementation of std::enable_shared_from_this,
with a matching creator function. The additional benefit is that we
can get rid of explicit static "create" methods by making that create
function a friend.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2020-12-05 21:28:08 +01:00
..
README source -> datastore rename, improved terminology 2014-07-28 15:29:41 +02:00
SQLiteContactSource.cpp C++: avoid "using namespace std" 2020-12-05 21:28:08 +01:00
SQLiteContactSource.h C++: replace boost::shared_ptr, boost::function, boost::bind 2020-12-05 21:28:08 +01:00
SQLiteContactSourceRegister.cpp C++: replace boost::shared_ptr, boost::function, boost::bind 2020-12-05 21:28:08 +01:00
SQLiteUtil.cpp C++: avoid "using namespace std" 2020-12-05 21:28:08 +01:00
SQLiteUtil.h C++: avoid "using namespace std" 2020-12-05 21:28:08 +01:00
configure-sub.in Port build system to non-recursive Automake. 2011-08-30 16:38:34 +02:00
sqlite.am autotools: avoid -lrt in make dependencies 2013-02-26 12:03:45 +01:00

README

This is a demo backend. It uses a database schema that is similar to
the one used on the iPhone, but it is not as complete.

To compile this backend as part of SyncEvolution, configure with
--enable-sqlite.

To compile it against a binary distribution of SyncEvolution, make
sure that the SyncEvolution, Synthesis and sqlite developer files are
installed and that pkg-config can find syncevolution.pc, synthesis.pc
and sqlite.pc. Set your PKG_CONFIG_PATH if necessary.

Then the source files can be compiled as follows:
   g++ -fpic -DPIC -DENABLE_SQLITE -shared -I. \
       `pkg-config --cflags --libs syncevolution`
       `pkg-config --cflags --libs sqlite`
       *.cpp  \
       -o /tmp/syncsqlite.so

Install /tmp/syncsqlite.so by moving it into the
"lib/syncevolution/backends" directory of the SyncEvolution
installation.

It then should show up as additional choice for the "type" property:
   syncevolution --datastore-property type=?

   ...
   SQLite Address Book = addressbook = contacts = sqlite-contacts
      vCard 2.1 (default) = text/x-vcard