1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-31 08:58:43 +01:00

Cut and paste TransactionScope into DBConnection.* files

This commit is contained in:
Paul Licameli
2020-09-02 15:17:51 -04:00
parent ddc2593282
commit e7b3c2b99f
6 changed files with 125 additions and 124 deletions

View File

@@ -24,7 +24,6 @@ struct sqlite3_stmt;
struct sqlite3_value;
class AudacityProject;
class TransactionScope;
class DBConnection;
class ProjectSerializer;
class SqliteSampleBlock;
@@ -239,28 +238,6 @@ private:
bool mPrevTemporary;
};
// Make a savepoint (a transaction, possibly nested) with the given name;
// roll it back at destruction time, unless an explicit Commit() happened first.
// Commit() must not be called again after one successful call.
// An exception is thrown from the constructor if the transaction cannot open.
class TransactionScope
{
public:
TransactionScope(DBConnection &connection, const char *name);
~TransactionScope();
bool Commit();
private:
bool TransactionStart(const wxString &name);
bool TransactionCommit(const wxString &name);
bool TransactionRollback(const wxString &name);
DBConnection &mConnection;
bool mInTrans;
wxString mName;
};
class wxTopLevelWindow;
// TitleRestorer restores project window titles to what they were, in its destructor.