diff --git a/db/dbbase.cpp b/db/dbbase.cpp index 9806018..0eb0ece 100755 --- a/db/dbbase.cpp +++ b/db/dbbase.cpp @@ -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 ) diff --git a/db/dbbase.h b/db/dbbase.h index fc83aab..04b5a59 100755 --- a/db/dbbase.h +++ b/db/dbbase.h @@ -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);