Ejemplo n.º 1
0
void ConfigManager::initSQLite()
{
	if (m_databasePath == "")
	{
		m_databasePath = CGetPath::GetCurrentExePath() + CGetPath::GetCurrentExeName() + ".db";
	}
	m_spConfig = nullptr;
	m_spConfig.reset(new SQLite(m_databasePath));
	m_tableName = "g_config";
	createTableIfNotExist(m_tableName);
}
Ejemplo n.º 2
0
void SQLiteGateWriterImpl::openDB(std::string dbFileName) {
	int rc;

	rc = sqlite3_open_v2(dbFileName.c_str(), &m_pDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
	if (rc) {
		fprintf(stderr, "Can not open DB due to error %d\n", rc);
		perror("Can not open database");
		throw (1);
	}

	createTableIfNotExist();
}
Ejemplo n.º 3
0
SQLiteGateWriterImpl::SQLiteGateWriterImpl(MatrixWriterPtr pMatrixWriter, sqlite3* pDb) : BinaryGateWriterImpl(pMatrixWriter) {
	m_dbOpennedHere = false;
	m_pDb = pDb;
	createTableIfNotExist();
	prepareInsertStatements();
}