added: to DbBase:

bool EndTrans(bool everything_ok);



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@873 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-08-15 19:33:20 +00:00
parent e739f30088
commit cc71c225a3
2 changed files with 22 additions and 0 deletions

View File

@ -429,6 +429,25 @@ Error DbBase::CommitTrans()
bool DbBase::EndTrans(bool everything_ok)
{
bool result;
if( everything_ok )
{
result = (CommitTrans() == WINIX_ERR_OK);
}
else
{
RollbackTrans();
// we return the old err code
result = false;
}
return result;
}
Error DbBase::EndTrans(Error err)
{
if( err == WINIX_ERR_OK )

View File

@ -72,6 +72,9 @@ public:
Error CommitTrans();
Error EndTrans(Error err);
// new API (returns only bool)
bool EndTrans(bool everything_ok);
static void UnescapeBin(const char * str, size_t len, std::string & out, bool clear_out = true);