MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

Functions
Util.hxx File Reference
`#include "Error.hxx"`
`#include <sqlite3.h>`
`#include <assert.h>`
Include dependency graph for Util.hxx:

Go to the source code of this file.

## Functions
static void | Bind (sqlite3_stmt *stmt, unsigned i, const char *value)
| Throws SqliteError on error. More...
template<typename... Args>
static void | BindAll2 (gcc_unused sqlite3_stmt *stmt, gcc_unused unsigned i)
template<typename... Args>
static void | BindAll2 (sqlite3_stmt *stmt, unsigned i, const char *value, Args &&...args)
template<typename... Args>
static void | BindAll (sqlite3_stmt *stmt, Args &&...args)
| Throws SqliteError on error. More...
static int | ExecuteBusy (sqlite3_stmt *stmt)
| Call sqlite3_stmt() repepatedly until something other than SQLITE_BUSY is returned. More...
static bool | ExecuteRow (sqlite3_stmt *stmt)
| Wrapper for ExecuteBusy() that returns true on SQLITE_ROW. More...
static void | ExecuteCommand (sqlite3_stmt *stmt)
| Wrapper for ExecuteBusy() that interprets everything other than SQLITE_DONE as error. More...
static unsigned | ExecuteChanges (sqlite3_stmt *stmt)
| Wrapper for ExecuteCommand() that returns the number of rows modified via sqlite3_changes(). More...
static bool | ExecuteModified (sqlite3_stmt *stmt)
| Wrapper for ExecuteChanges() that returns true if at least one row was modified. More...
template<typename F >
static void | ExecuteForEach (sqlite3_stmt *stmt, F &&f)

## Function Documentation

static void Bind | ( | sqlite3_stmt * | stmt,
|  | unsigned | i,
|  | const char * | value
| ) |  |
| static

Throws SqliteError on error.

Definition at line 33 of file Util.hxx.

template<typename... Args>

static void BindAll | ( | sqlite3_stmt * | stmt,
|  | Args &&... | args
| ) |  |
| static

Throws SqliteError on error.

Definition at line 61 of file Util.hxx.

template<typename... Args>

static void BindAll2 | ( | gcc_unused sqlite3_stmt * | stmt,
|  | gcc_unused unsigned | i
| ) |  |
| static

Definition at line 42 of file Util.hxx.

template<typename... Args>

static void BindAll2 | ( | sqlite3_stmt * | stmt,
|  | unsigned | i,
|  | const char * | value,
|  | Args &&... | args
| ) |  |
| static

Definition at line 49 of file Util.hxx.

static int ExecuteBusy | ( | sqlite3_stmt * | stmt | ) |
| static

Call sqlite3_stmt() repepatedly until something other than SQLITE_BUSY is returned.

Definition at line 73 of file Util.hxx.

static unsigned ExecuteChanges | ( | sqlite3_stmt * | stmt | ) |
| inline static

Wrapper for ExecuteCommand() that returns the number of rows modified via sqlite3_changes().

Throws SqliteError on error.

Definition at line 122 of file Util.hxx.

static void ExecuteCommand | ( | sqlite3_stmt * | stmt | ) |
| static

Wrapper for ExecuteBusy() that interprets everything other than SQLITE_DONE as error.

Throws SqliteError on error.

Definition at line 108 of file Util.hxx.

template<typename F >

static void ExecuteForEach | ( | sqlite3_stmt * | stmt,
|  | F && | f
| ) |  |
| inline static

Definition at line 143 of file Util.hxx.

static bool ExecuteModified | ( | sqlite3_stmt * | stmt | ) |
| inline static

Wrapper for ExecuteChanges() that returns true if at least one row was modified.

Returns false if nothing was modified.

Throws SqliteError on error.

Definition at line 136 of file Util.hxx.

static bool ExecuteRow | ( | sqlite3_stmt * | stmt | ) |
| static

Wrapper for ExecuteBusy() that returns true on SQLITE_ROW.

Throws SqliteError on error.

Definition at line 89 of file Util.hxx.