From abafb52f37beb5659efc2105ccd1568e1f754898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 4 Dec 2014 18:29:42 +0100 Subject: make most headers private --- include/mbgl/util/sqlite3.hpp | 74 ------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 include/mbgl/util/sqlite3.hpp (limited to 'include/mbgl/util/sqlite3.hpp') diff --git a/include/mbgl/util/sqlite3.hpp b/include/mbgl/util/sqlite3.hpp deleted file mode 100644 index 3e324f7ce1..0000000000 --- a/include/mbgl/util/sqlite3.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include - -typedef struct sqlite3 sqlite3; -typedef struct sqlite3_stmt sqlite3_stmt; - -namespace mapbox { -namespace sqlite { - -enum OpenFlag : int { - ReadOnly = 0x00000001, - ReadWrite = 0x00000002, - Create = 0x00000004, - NoMutex = 0x00008000, - FullMutex = 0x00010000, - SharedCache = 0x00020000, - PrivateCache = 0x00040000, -}; - -struct Exception : std::runtime_error { - inline Exception(int err, const char *msg) : std::runtime_error(msg), code(err) {} - const int code = 0; -}; - -class Statement; - -class Database { -private: - Database(const Database &) = delete; - Database &operator=(const Database &) = delete; - -public: - Database(const std::string &filename, int flags = 0); - Database(Database &&); - ~Database(); - Database &operator=(Database &&); - - operator bool() const; - - void exec(const std::string &sql); - Statement prepare(const char *query); - -private: - sqlite3 *db = nullptr; -}; - -class Statement { -private: - Statement(const Statement &) = delete; - Statement &operator=(const Statement &) = delete; - -public: - Statement(sqlite3 *db, const char *sql); - Statement(Statement &&); - ~Statement(); - Statement &operator=(Statement &&); - - operator bool() const; - - template void bind(int offset, T value); - void bind(int offset, const std::string &value, bool retain = true); - template T get(int offset); - - bool run(); - void reset(); - -private: - sqlite3_stmt *stmt = nullptr; -}; - -} -} -- cgit v1.2.1