~ubuntu-branches/debian/sid/aptitude/sid

« back to all changes in this revision

Viewing changes to src/generic/util/sqlite.h

  • Committer: Package Import Robot
  • Author(s): Axel Beckert, Manuel A. Fernandez Montecelo, Axel Beckert
  • Date: 2015-08-05 19:05:18 UTC
  • mfrom: (4.1.20)
  • Revision ID: package-import@ubuntu.com-20150805190518-wdruntmd18qzarm0
Tags: 0.7-1
[ Manuel A. Fernandez Montecelo ]
* New upstream release.
  - Changes in the versioning scheme and changelog (to follow loosely
    the Semantic Version specification)
  - Feature removal: The content-wise outdated and
    not-multiarch-compatible categorical browser has been removed. The
    Debtags browser has replaced most of its functionality already. Local
    package groups are no more available, though.  The removal discussion
    has taken place in #686646. (Closes: #686124, #686142, #686646 as
    well as LP: #1082198).
  - Changes to allow to compile with C++11 compatibilty mode (prompted by
    changes in the toolchain in Debian) (Closes: #777778)
  - Fix reported installed size change when installing/deinstalling
    packages which are bigger than 2 GiB (int type size 32 bits).  Thanks
    Benny Baumann and Jason Rhinelander for the report and info, and Sven
    Joachim for the patch.  (Closes: #759769)
  - Changes in automake files to be able to use current automake
    versions.
  - Documentation:
    - Previously missing trigger-related package states are now
      documented. (Closes: #770073, #771305, #771704)
    - Minesweeper: Fixed save/load keybindings in help.
      (Closes: #736934)
  - Translation updates:
    - Czech by Miroslav Kure (Closes: #758226)
    - Russian by Yuri Kozlov (Closes: #760812)
    - German man page translation by Mario Blättermann and
      Jens Seidel (Closes: #762340)
    - Catalan by Orestes Mas (Closes: #771618)
    - French documentation translation by Cédric Boutillier
      (Closes: #773807)
    - Italian documentation translation by Beatrice Torracca
      (Closes: #776706)
    - Dutch by Frans Spiesschaert (Closes: #778425)

[ Axel Beckert ]
* Apply wrap-and-sort.
* No more install files related to the categorical browser.
* Update Vcs-Browser header to use cgit and HTTPS.
* Declare compliance with Debian Policy 3.9.6. (No changes needed.)
* debian/rules:
  + Remove override_dh_builddeb: xz compression is default nowadays.
  + Remove obsolete x from [ "x$var" != "x" ] comparisons.
* Add myself to Uploaders.
* Cherry-pick 3593bdcb, 2a5a8b25, and 4b24b358 from upstream to cope
  with Boost 1.58 which has been uploaded to unstable during the
  libstdc++6 transition, but after the 0.7 upstream release.
* Temporarily bump g++ dependency from 4:3.2.2-0 to 4:5.2 for the
  gcc-5/libstdc++6 transition.
* Add build-dependency on automake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#include <sqlite3.h>
31
31
 
32
 
#include <boost/make_shared.hpp>
33
32
#include <boost/multi_index_container.hpp>
34
33
#include <boost/multi_index/hashed_index.hpp>
35
34
#include <boost/multi_index/sequenced_index.hpp>
36
35
#include <boost/multi_index/member.hpp>
37
 
#include <boost/shared_ptr.hpp>
38
36
#include <boost/unordered_set.hpp>
39
37
 
 
38
#include <memory>
 
39
 
40
40
// C++ wrapper for sqlite to handle tracking and releasing resources.
41
41
 
42
42
namespace aptitude
98
98
      struct statement_cache_entry
99
99
      {
100
100
        std::string sql;
101
 
        boost::shared_ptr<statement> stmt;
 
101
        std::shared_ptr<statement> stmt;
102
102
 
103
103
        statement_cache_entry(const std::string &_sql,
104
 
                              const boost::shared_ptr<statement> &_stmt)
 
104
                              const std::shared_ptr<statement> &_stmt)
105
105
          : sql(_sql), stmt(_stmt)
106
106
        {
107
107
        }
159
159
        {
160
160
        }
161
161
 
162
 
        const boost::shared_ptr<statement> &get_statement() const { return entry.stmt; }
 
162
        const std::shared_ptr<statement> &get_statement() const { return entry.stmt; }
163
163
        const statement_cache_entry &get_entry() const { return entry; }
164
164
 
165
165
        ~statement_proxy_impl();
192
192
       *
193
193
       *  See the sqlite3_open documentation for details.
194
194
       */
195
 
      static boost::shared_ptr<db>
 
195
      static std::shared_ptr<db>
196
196
      create(const std::string &filename,
197
197
             int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
198
198
             const char *vfs = NULL)
199
199
      {
200
 
        return boost::shared_ptr<db>(new db(filename, flags, vfs));
 
200
        return std::shared_ptr<db>(new db(filename, flags, vfs));
201
201
      }
202
202
 
203
203
      /** \brief Close the encapsulated database. */
256
256
       */
257
257
      class statement_proxy
258
258
      {
259
 
        boost::shared_ptr<statement_proxy_impl> impl;
 
259
        std::shared_ptr<statement_proxy_impl> impl;
260
260
 
261
261
        friend class db;
262
262
 
263
 
        statement_proxy(const boost::shared_ptr<statement_proxy_impl> &_impl)
 
263
        statement_proxy(const std::shared_ptr<statement_proxy_impl> &_impl)
264
264
          : impl(_impl)
265
265
        {
266
266
        }
376
376
      friend class db::statement_proxy_impl;
377
377
 
378
378
      statement(db &_parent, sqlite3_stmt *_handle);
379
 
#if defined(BOOST_MAKE_SHARED_SHARED_PTR)
380
 
      template<typename A, typename B, typename C>
381
 
      friend boost::shared_ptr<A> boost::make_shared(const B &, const C &);
382
 
#elif defined(BOOST_MAKE_SHARED_SP_IF_NOT_ARRAY_TYPE)
383
 
      // FIXME: Ouch.  Boost 1.53 requires this mess or something else
384
 
      // I haven't worked out yet.
385
 
      template<typename A, typename B, typename C>
386
 
      friend typename boost::detail::sp_if_not_array<A>::type boost::make_shared(const B &, const C &);
387
 
#endif
388
379
 
389
380
      /** \brief Throw an exception if there isn't result data ready
390
381
       *  to be read.
412
403
 
413
404
      /** \brief Prepare an SQL statement.
414
405
       */
415
 
      static boost::shared_ptr<statement>
 
406
      static std::shared_ptr<statement>
416
407
      prepare(db &parent,
417
408
              const std::string &sql);
418
409
 
419
 
      /** \brief Prepare an SQL statement.
420
 
       */
421
 
      static boost::shared_ptr<statement>
422
 
      prepare(db &parent,
423
 
              const char *sql);
424
 
 
425
410
      /** \brief Return to the beginning of the statement's result set
426
411
       *  and discard parameter bindings.
427
412
       */
462
447
       */
463
448
      void bind_int(int parameter_idx, int value);
464
449
 
465
 
 
466
450
      /** \brief Bind a 64-bit integer to a parameter.
467
451
       *
468
452
       *  \param parameter_idx  The one-based index of the parameter to set.
576
560
      friend class db;
577
561
 
578
562
      blob(db &_parent, sqlite3_blob *_handle);
579
 
#if defined(BOOST_MAKE_SHARED_SHARED_PTR)
580
 
      template<typename A, typename B, typename C>
581
 
      friend boost::shared_ptr<A> boost::make_shared(const B &, const C &);
582
 
#elif defined(BOOST_MAKE_SHARED_SP_IF_NOT_ARRAY_TYPE)
583
 
      // FIXME: Ouch.  Again.
584
 
      template<typename A, typename B, typename C>
585
 
      friend typename boost::detail::sp_if_not_array<A>::type boost::make_shared(const B &, const C &);
586
 
#endif
587
563
 
588
564
    public:
589
565
      /** \brief Open an existing BLOB.
598
574
       *                      read-only; otherwise it will be opened
599
575
       *                      read-write.
600
576
       */
601
 
      static boost::shared_ptr<blob>
 
577
      static std::shared_ptr<blob>
602
578
      open(db &parent,
603
579
           const std::string &databaseName,
604
580
           const std::string &table,