QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsspatialiteutils.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsspatialiteutils.h
3
-------------------
4
begin : Nov, 2017
5
copyright : (C) 2017 by Matthias Kuhn
6
email : matthias@opengis.ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSSPATIALITEUTILS_H
19
#define QGSSPATIALITEUTILS_H
20
21
22
#include <functional>
23
24
#include "qgis_core.h"
25
#include "
qgssqliteutils.h
"
26
27
#define SIP_NO_FILE
28
35
struct
CORE_EXPORT
QgsSpatialiteCloser
36
{
40
void
operator()
(
sqlite3
*database );
41
45
void
*
mSpatialiteContext
=
nullptr
;
46
};
47
55
class
CORE_EXPORT
spatialite_database_unique_ptr
:
public
std::unique_ptr< sqlite3, QgsSpatialiteCloser>
56
{
57
public
:
63
int
open
(
const
QString &path );
64
68
void
reset
();
69
77
void
reset
(
sqlite3
*handle ) =
delete
;
78
84
int
open_v2
(
const
QString &path,
int
flags,
const
char
*zVfs );
85
89
QString
errorMessage
()
const
;
90
95
sqlite3_statement_unique_ptr
prepare
(
const
QString &sql,
int
&resultCode );
96
};
97
98
#endif
// QGSSPATIALITEUTILS_H
spatialite_database_unique_ptr
Unique pointer for spatialite databases, which automatically closes the database when the pointer goe...
Definition
qgsspatialiteutils.h:56
spatialite_database_unique_ptr::reset
void reset(sqlite3 *handle)=delete
It is not allowed to set an arbitrary sqlite3 handle on this object.
spatialite_database_unique_ptr::open
int open(const QString &path)
Opens the database at the specified file path.
Definition
qgsspatialiteutils.cpp:49
spatialite_database_unique_ptr::prepare
sqlite3_statement_unique_ptr prepare(const QString &sql, int &resultCode)
Prepares a sql statement, returning the result.
Definition
qgsspatialiteutils.cpp:102
spatialite_database_unique_ptr::open_v2
int open_v2(const QString &path, int flags, const char *zVfs)
Opens the database at the specified file path.
Definition
qgsspatialiteutils.cpp:73
spatialite_database_unique_ptr::errorMessage
QString errorMessage() const
Returns the most recent error message encountered by the database.
Definition
qgsspatialiteutils.cpp:97
spatialite_database_unique_ptr::reset
void reset()
Will close the connection and set the internal pointer to nullptr.
Definition
qgsspatialiteutils.cpp:68
sqlite3_statement_unique_ptr
Unique pointer for sqlite3 prepared statements, which automatically finalizes the statement when the ...
Definition
qgssqliteutils.h:67
sqlite3
struct sqlite3 sqlite3
Definition
qgscoordinatereferencesystem.h:61
qgssqliteutils.h
QgsSpatialiteCloser
Closes a spatialite database.
Definition
qgsspatialiteutils.h:36
QgsSpatialiteCloser::operator()
void operator()(sqlite3 *database)
Closes an spatialite database.
Definition
qgsspatialiteutils.cpp:113
QgsSpatialiteCloser::mSpatialiteContext
void * mSpatialiteContext
Keep track of the spatialite context.
Definition
qgsspatialiteutils.h:45
Generated on
for QGIS API Documentation by
1.17.0