diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 19:02:28 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 19:02:28 +0100 |
commit | 221b08e07246e84587b4144eca5564ce9ad3a20a (patch) | |
tree | d46a71a331ff51a92c1c332e57e0a7c88851a713 /frontend/DB.cpp | |
parent | ca3e80a5b474d99391c253d3173117e955e33a20 (diff) |
implement leaderboard functionality
Diffstat (limited to 'frontend/DB.cpp')
-rw-r--r-- | frontend/DB.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/DB.cpp b/frontend/DB.cpp index f40a9fd..28a1c3d 100644 --- a/frontend/DB.cpp +++ b/frontend/DB.cpp @@ -77,24 +77,24 @@ DBQueryRow DBStatement::row() { DBQueryRow::DBQueryRow(DBStatement & parent) : parent(parent) { } template <> -const char * DBQueryRow::col<const char*>(int index, const char * const & default_value) { +const char * DBQueryRow::col<const char*>(int index, const char * const & default_value) const { int type = sqlite3_column_type(this->parent.stmt.get(), index); if (type == SQLITE_NULL) return default_value; return reinterpret_cast<const char *>(sqlite3_column_text(this->parent.stmt.get(), index)); } template <> -const char * DBQueryRow::col<const char*>(int index) { +const char * DBQueryRow::col<const char*>(int index) const { return this->col<const char *>(index, ""); } template <> -int DBQueryRow::col<int>(int index, const int & default_value) { +int DBQueryRow::col<int>(int index, const int & default_value) const { int type = sqlite3_column_type(this->parent.stmt.get(), index); if (type == SQLITE_NULL) return default_value; return sqlite3_column_int(this->parent.stmt.get(), index); } template <> -int DBQueryRow::col<int>(int index) { +int DBQueryRow::col<int>(int index) const { return this->col<int>(index, 0); } |