summaryrefslogtreecommitdiff
path: root/plugins/Import/src/dbrw/dbcontacts.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-03-07 00:54:57 +0300
committeraunsane <aunsane@gmail.com>2018-03-07 00:54:57 +0300
commit7e9fef8a6ff35c63f9217fcc618d77f660e45245 (patch)
tree319319349fbdbec1def789f67ca7f2f7ccdab77a /plugins/Import/src/dbrw/dbcontacts.cpp
parent3eaee7138f6f34cb05c963993eca48b7429f2456 (diff)
Import: first compiled version of dbrw loader
Diffstat (limited to 'plugins/Import/src/dbrw/dbcontacts.cpp')
-rw-r--r--plugins/Import/src/dbrw/dbcontacts.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/Import/src/dbrw/dbcontacts.cpp b/plugins/Import/src/dbrw/dbcontacts.cpp
new file mode 100644
index 0000000000..c3aac4b1bc
--- /dev/null
+++ b/plugins/Import/src/dbrw/dbcontacts.cpp
@@ -0,0 +1,54 @@
+/*
+
+Import plugin for Miranda NG
+
+Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "../stdafx.h"
+
+STDMETHODIMP_(BOOL) CDbxSQLite::IsDbContact(MCONTACT contactID)
+{
+ DBCachedContact *cc = m_cache->GetCachedContact(contactID);
+ return (cc != nullptr);
+}
+
+STDMETHODIMP_(LONG) CDbxSQLite::GetContactCount(void)
+{
+ int res = 0;
+ sqlite3_bind_int(ctc_stmts_prep[SQL_CTC_STMT_COUNT], 1, res);
+ if (sql_step(ctc_stmts_prep[SQL_CTC_STMT_COUNT]) == SQLITE_ROW)
+ res = sqlite3_column_int(ctc_stmts_prep[SQL_CTC_STMT_COUNT], 0);
+ sql_reset(ctc_stmts_prep[SQL_CTC_STMT_COUNT]);
+ return res;
+}
+
+STDMETHODIMP_(LONG) CDbxSQLite::GetContactSize(void)
+{
+ return sizeof(DBCachedContact);
+}
+
+STDMETHODIMP_(MCONTACT) CDbxSQLite::AddContact(void)
+{
+ return INVALID_CONTACT_ID;
+}
+
+STDMETHODIMP_(LONG) CDbxSQLite::DeleteContact(MCONTACT)
+{
+ return 1;
+} \ No newline at end of file