抛弃GdCpp*.dll/pdb历史重新建库。libhv和Sqlite的dll保留

This commit is contained in:
Zhang Jianjun
2026-02-02 16:09:02 +08:00
parent f148ca49e3
commit 4a2a284ac0
292 changed files with 350450 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
/**
* @file CSQLiteTransaction.cpp
* @ingroup SQLiteCpp
* @brief A CSQLiteTransaction is way to group multiple SQL statements into an atomic secured operation.
*
* Copyright (c) 2012-2013 Sebastien Rombauts (sebastien.rombauts@gmail.com)
*
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
* or copy at http://opensource.org/licenses/MIT)
*/
#include "pch.h"
#include "CSQLite/CSQLiteTransaction.h"
#include "CSQLite/CSQLiteDB.h"
// Begins the SQLite CSQLiteTransaction
CSQLiteTransaction::CSQLiteTransaction(CSQLiteDB & aDatabase, bool startnow) :
mDatabase(aDatabase),
mbCommited(false)
{
if(startnow)
{
mDatabase.exec("BEGIN");
mbCommited = false;
}else{
mbCommited = true;
}
}
// Safely rollback the CSQLiteTransaction if it has not been committed.
CSQLiteTransaction::~CSQLiteTransaction()
{
if (false == mbCommited)
{
try
{
mDatabase.exec("ROLLBACK");
}
catch (CSQLiteException&)
{
// Never throw an exception in a destructor: error if already rollbacked, but no harm is caused by this.
}
}
}
// Commit the CSQLiteTransaction.
void CSQLiteTransaction::commit()
{
if (false == mbCommited)
{
mDatabase.exec("COMMIT");
mbCommited = true;
}
else
{
throw CSQLiteException("CSQLiteTransaction already commited.");
}
}