1
0
Fork 0
forked from blue/lmdbal

big refactoring part 1

This commit is contained in:
Blue 2023-03-20 18:37:13 +03:00
parent 6a8f67ac34
commit 19229f6c26
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
28 changed files with 867 additions and 795 deletions

View file

@ -14,17 +14,16 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CORE_DATABASE_EXCEPTIONS_H
#define CORE_DATABASE_EXCEPTIONS_H
#ifndef LMDBDATABASE_EXCEPTIONS_H
#define LMDBDATABASE_EXCEPTIONS_H
#include <stdexcept>
#include <string>
#include <optional>
#include "database.h"
namespace LMDBDataBase {
class DataBase::Exception : public std::exception
{
class Exception : public std::exception {
public:
Exception();
virtual ~Exception();
@ -34,7 +33,7 @@ public:
const char* what() const noexcept( true );
};
class DataBase::Directory: public DataBase::Exception {
class Directory: public Exception {
public:
Directory(const std::string& path);
@ -43,7 +42,7 @@ private:
std::string path;
};
class DataBase::Closed : public DataBase::Exception {
class Closed : public Exception {
public:
Closed(const std::string& p_operation, const std::string& dbName, const std::optional<std::string>& tableName = std::nullopt);
@ -54,7 +53,7 @@ private:
std::optional<std::string> tableName;
};
class DataBase::Opened : public DataBase::Exception {
class Opened : Exception {
public:
Opened(const std::string& dbName, const std::string& action);
@ -64,7 +63,7 @@ private:
std::string action;
};
class DataBase::NotFound : public DataBase::Exception {
class NotFound : public Exception {
public:
NotFound(const std::string& key, const std::string& dbName, const std::string& tableName);
@ -75,7 +74,7 @@ private:
std::string tableName;
};
class DataBase::Exist : public DataBase::Exception {
class Exist : public Exception {
public:
Exist(const std::string& key, const std::string& dbName, const std::string& tableName);
@ -86,7 +85,7 @@ private:
std::string tableName;
};
class DataBase::Unknown : public DataBase::Exception {
class Unknown : public Exception {
public:
Unknown(const std::string& dbName, const std::string& message, const std::optional<std::string>& tableName = std::nullopt);
@ -97,4 +96,6 @@ private:
std::string msg;
};
#endif //CORE_DATABASE_EXCEPTIONS_H
}
#endif //LMDBDATABASE_EXCEPTIONS_H