-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathsqlitedatabasedoesnotexisterror.hpp
More file actions
49 lines (36 loc) · 1.44 KB
/
Copy pathsqlitedatabasedoesnotexisterror.hpp
File metadata and controls
49 lines (36 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#ifndef ORM_EXCEPTIONS_SQLITEDATABASEDOESNOTEXISTERROR_HPP
#define ORM_EXCEPTIONS_SQLITEDATABASEDOESNOTEXISTERROR_HPP
#include "orm/macros/systemheader.hpp"
TINY_SYSTEM_HEADER
#include "orm/exceptions/invalidargumenterror.hpp"
TINYORM_BEGIN_COMMON_NAMESPACE
namespace Orm::Exceptions
{
/*! TinyORM SQLite database doesn't exist exception. */
class TINYORM_EXPORT SQLiteDatabaseDoesNotExistError : public InvalidArgumentError // clazy:exclude=copyable-polymorphic
{
public:
/*! Path constructor (QString). */
inline explicit SQLiteDatabaseDoesNotExistError(const QString &path);
/*! Get the path to the database. */
inline const QString &getPath() const noexcept;
protected:
/*! The path to the database. */
QString m_path;
};
/* public */
SQLiteDatabaseDoesNotExistError::SQLiteDatabaseDoesNotExistError(const QString &path)
: InvalidArgumentError(QStringLiteral(
"SQLite Database file '%1' does not exist, please "
"insert an absolute path to the database.")
.arg(path).toUtf8().constData())
, m_path(path)
{}
const QString &SQLiteDatabaseDoesNotExistError::getPath() const noexcept
{
return m_path;
}
} // namespace Orm::Exceptions
TINYORM_END_COMMON_NAMESPACE
#endif // ORM_EXCEPTIONS_SQLITEDATABASEDOESNOTEXISTERROR_HPP