forked from qt-creator/qt-creator
Sqlite: Add change set iterator
Task-number: QDS-2998 Change-Id: I7bfa8af51d9d7e6122902ee132ad51019e20afb5 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -37,12 +37,15 @@ namespace Sqlite {
|
||||
class SQLITE_EXPORT Exception : public std::exception
|
||||
{
|
||||
public:
|
||||
Exception(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
Exception(const char *whatErrorHasHappen, Utils::SmallString &&sqliteErrorMessage)
|
||||
: m_whatErrorHasHappen(whatErrorHasHappen)
|
||||
, m_sqliteErrorMessage(std::move(sqliteErrorMessage))
|
||||
{}
|
||||
|
||||
Exception(const char *whatErrorHasHappen)
|
||||
: m_whatErrorHasHappen(whatErrorHasHappen)
|
||||
{}
|
||||
|
||||
const char *what() const noexcept override { return m_whatErrorHasHappen; }
|
||||
|
||||
void printWarning() const;
|
||||
@@ -58,8 +61,7 @@ public:
|
||||
StatementIsBusy(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseIsBusy : public Exception
|
||||
@@ -67,8 +69,7 @@ class DatabaseIsBusy : public Exception
|
||||
public:
|
||||
DatabaseIsBusy(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class StatementHasError : public Exception
|
||||
@@ -77,8 +78,7 @@ public:
|
||||
StatementHasError(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class StatementIsMisused : public Exception
|
||||
@@ -87,8 +87,7 @@ public:
|
||||
StatementIsMisused(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class InputOutputError : public Exception
|
||||
@@ -96,8 +95,7 @@ class InputOutputError : public Exception
|
||||
public:
|
||||
InputOutputError(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class ConstraintPreventsModification : public Exception
|
||||
@@ -106,8 +104,7 @@ public:
|
||||
ConstraintPreventsModification(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class NoValuesToFetch : public Exception
|
||||
@@ -115,8 +112,7 @@ class NoValuesToFetch : public Exception
|
||||
public:
|
||||
NoValuesToFetch(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class ColumnCountDoesNotMatch : public Exception
|
||||
@@ -133,8 +129,7 @@ public:
|
||||
BindingIndexIsOutOfRange(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class WrongBindingName : public Exception
|
||||
@@ -142,8 +137,7 @@ class WrongBindingName : public Exception
|
||||
public:
|
||||
WrongBindingName(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseIsNotOpen : public Exception
|
||||
@@ -151,8 +145,7 @@ class DatabaseIsNotOpen : public Exception
|
||||
public:
|
||||
DatabaseIsNotOpen(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseCannotBeOpened : public Exception
|
||||
@@ -161,8 +154,7 @@ public:
|
||||
DatabaseCannotBeOpened(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&errorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(errorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseFilePathIsEmpty : public DatabaseCannotBeOpened
|
||||
@@ -170,8 +162,7 @@ class DatabaseFilePathIsEmpty : public DatabaseCannotBeOpened
|
||||
public:
|
||||
DatabaseFilePathIsEmpty(const char *whatErrorHasHappen)
|
||||
: DatabaseCannotBeOpened(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseIsAlreadyOpen : public DatabaseCannotBeOpened
|
||||
@@ -179,8 +170,7 @@ class DatabaseIsAlreadyOpen : public DatabaseCannotBeOpened
|
||||
public:
|
||||
DatabaseIsAlreadyOpen(const char *whatErrorHasHappen)
|
||||
: DatabaseCannotBeOpened(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseCannotBeClosed : public Exception
|
||||
@@ -188,8 +178,7 @@ class DatabaseCannotBeClosed : public Exception
|
||||
public:
|
||||
DatabaseCannotBeClosed(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DatabaseIsAlreadyClosed : public DatabaseCannotBeClosed
|
||||
@@ -197,8 +186,7 @@ class DatabaseIsAlreadyClosed : public DatabaseCannotBeClosed
|
||||
public:
|
||||
DatabaseIsAlreadyClosed(const char *whatErrorHasHappen)
|
||||
: DatabaseCannotBeClosed(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class WrongFilePath : public DatabaseCannotBeOpened
|
||||
@@ -207,8 +195,7 @@ public:
|
||||
WrongFilePath(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&errorMessage = Utils::SmallString())
|
||||
: DatabaseCannotBeOpened(whatErrorHasHappen, std::move(errorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class PragmaValueNotSet : public Exception
|
||||
@@ -216,8 +203,7 @@ class PragmaValueNotSet : public Exception
|
||||
public:
|
||||
PragmaValueNotSet(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class NotReadOnlySqlStatement : public Exception
|
||||
@@ -225,8 +211,7 @@ class NotReadOnlySqlStatement : public Exception
|
||||
public:
|
||||
NotReadOnlySqlStatement(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class NotWriteSqlStatement : public Exception
|
||||
@@ -234,8 +219,7 @@ class NotWriteSqlStatement : public Exception
|
||||
public:
|
||||
NotWriteSqlStatement(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class DeadLock : public Exception
|
||||
@@ -243,8 +227,7 @@ class DeadLock : public Exception
|
||||
public:
|
||||
DeadLock(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class UnknowError : public Exception
|
||||
@@ -253,8 +236,7 @@ public:
|
||||
UnknowError(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&errorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(errorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class BindingTooBig : public Exception
|
||||
@@ -263,8 +245,7 @@ public:
|
||||
BindingTooBig(const char *whatErrorHasHappen,
|
||||
Utils::SmallString &&errorMessage = Utils::SmallString())
|
||||
: Exception(whatErrorHasHappen, std::move(errorMessage))
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
class TooBig : public Exception
|
||||
@@ -387,4 +368,46 @@ public:
|
||||
: Exception(whatErrorHasHappen, std::move(errorMessage))
|
||||
{}
|
||||
};
|
||||
|
||||
class CannotCreateChangeSetIterator : public Exception
|
||||
{
|
||||
public:
|
||||
CannotCreateChangeSetIterator(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{}
|
||||
};
|
||||
|
||||
class CannotGetChangeSetOperation : public Exception
|
||||
{
|
||||
public:
|
||||
CannotGetChangeSetOperation(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{}
|
||||
};
|
||||
|
||||
class ChangeSetTupleIsOutOfRange : public Exception
|
||||
{
|
||||
public:
|
||||
ChangeSetTupleIsOutOfRange(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{}
|
||||
};
|
||||
|
||||
class ChangeSetTupleIsMisused : public Exception
|
||||
{
|
||||
public:
|
||||
ChangeSetTupleIsMisused(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
|
||||
{}
|
||||
};
|
||||
|
||||
class UnknownError : public Exception
|
||||
{
|
||||
public:
|
||||
UnknownError(const char *whatErrorHasHappen)
|
||||
: Exception(whatErrorHasHappen)
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace Sqlite
|
||||
|
||||
Reference in New Issue
Block a user