0.3.1 fix qt5 build, exception docs
This commit is contained in:
parent
2b4763b575
commit
4975721a5c
18
CHANGELOG.md
Normal file
18
CHANGELOG.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## LMDBAL 0.3.1 (April 14, 2023)
|
||||
### Bug fixes
|
||||
- build with qt5 now is possible again
|
||||
|
||||
### Improvements
|
||||
- exception documentation
|
||||
|
||||
## LMDBAL 0.3.0 (April 12, 2023)
|
||||
### New features
|
||||
- transaction functions
|
||||
|
||||
### Improvements
|
||||
- initial documentation
|
||||
- cache unit testing
|
||||
- transactions unit testing
|
||||
- serialization unit testing
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(LMDBAL
|
||||
VERSION 0.3.0
|
||||
VERSION 0.3.1
|
||||
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Maintainer: Yury Gubich <blue@macaw.me>
|
||||
pkgname=lmdbal
|
||||
pkgver=0.3.0
|
||||
pkgver=0.3.1
|
||||
pkgrel=1
|
||||
pkgdesc="LMDB Abstraction Layer, qt5 version"
|
||||
arch=('i686' 'x86_64')
|
||||
@ -11,7 +11,7 @@ makedepends=('cmake>=3.16')
|
||||
optdepends=()
|
||||
|
||||
source=("$pkgname-$pkgver.tar.gz::https://git.macaw.me/blue/lmdbal/archive/$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
sha256sums=('df1a9687d81d609d160754285f2613d7e07fc6deb781d0fb0084e4857ea82e95')
|
||||
build() {
|
||||
cd "$srcdir/$pkgname"
|
||||
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release -D QT_VERSION_MAJOR=5
|
||||
@ -19,5 +19,5 @@ build() {
|
||||
}
|
||||
package() {
|
||||
cd "$srcdir/$pkgname"
|
||||
cmake --install . --prefix $pkgdir/
|
||||
DESTDIR="$pkgdir/" cmake --install .
|
||||
}
|
||||
|
@ -25,18 +25,29 @@
|
||||
|
||||
namespace LMDBAL {
|
||||
|
||||
/**
|
||||
* \brief Parent abstract class for all LMDBAL exceptions
|
||||
*/
|
||||
class Exception : public std::exception {
|
||||
public:
|
||||
Exception();
|
||||
virtual ~Exception();
|
||||
|
||||
virtual std::string getMessage() const = 0;
|
||||
virtual std::string getMessage() const = 0; /**<\brief returns exception message*/
|
||||
|
||||
const char* what() const noexcept( true );
|
||||
const char* what() const noexcept( true ) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if LMDBAL had issues creating or opening database directory
|
||||
*/
|
||||
class Directory: public Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param path - path of the directory that was supposed to be used to store the database
|
||||
*/
|
||||
Directory(const std::string& path);
|
||||
|
||||
std::string getMessage() const;
|
||||
@ -44,9 +55,19 @@ private:
|
||||
std::string path;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if something in the database was called on closed state and it is not supported
|
||||
*/
|
||||
class Closed : public Exception {
|
||||
public:
|
||||
Closed(const std::string& p_operation, const std::string& dbName, const std::optional<std::string>& tableName = std::nullopt);
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param operation - text name of the method that was called on closed database
|
||||
* \param dbName - name of the database
|
||||
* \param tableName - name of the storage which called that method, abscent if it's untracable or if it's thrown by the database
|
||||
*/
|
||||
Closed(const std::string& operation, const std::string& dbName, const std::optional<std::string>& tableName = std::nullopt);
|
||||
|
||||
std::string getMessage() const;
|
||||
private:
|
||||
@ -55,8 +76,17 @@ private:
|
||||
std::optional<std::string> tableName;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if something in the database was called on opened state and it is not supported
|
||||
*/
|
||||
class Opened : Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param action - text name of the method that was called on opened database
|
||||
* \param dbName - name of the database
|
||||
*/
|
||||
Opened(const std::string& dbName, const std::string& action);
|
||||
|
||||
std::string getMessage() const;
|
||||
@ -65,8 +95,18 @@ private:
|
||||
std::string action;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if something in the database was not found
|
||||
*/
|
||||
class NotFound : public Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param key - record key that was not found
|
||||
* \param dbName - name of the database
|
||||
* \param tableName - name of the storage that was looked for a record
|
||||
*/
|
||||
NotFound(const std::string& key, const std::string& dbName, const std::string& tableName);
|
||||
|
||||
std::string getMessage() const;
|
||||
@ -76,8 +116,17 @@ private:
|
||||
std::string tableName;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if there was attempt to define storages with conflicting names
|
||||
*/
|
||||
class StorageDuplicate : public Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param dbName - name of the database
|
||||
* \param tableName - that name that was conflicting
|
||||
*/
|
||||
StorageDuplicate(const std::string& dbName, const std::string& tableName);
|
||||
|
||||
std::string getMessage() const;
|
||||
@ -86,8 +135,18 @@ private:
|
||||
std::string tableName;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if there was a key conflict in one of the storages
|
||||
*/
|
||||
class Exist : public Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param key - record key that caused the conflict
|
||||
* \param dbName - name of the database
|
||||
* \param tableName - name of the storage that was operated with
|
||||
*/
|
||||
Exist(const std::string& key, const std::string& dbName, const std::string& tableName);
|
||||
|
||||
std::string getMessage() const;
|
||||
@ -97,8 +156,18 @@ private:
|
||||
std::string tableName;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Thrown if something unexpected happened
|
||||
*/
|
||||
class Unknown : public Exception {
|
||||
public:
|
||||
/**
|
||||
* \brief Creates exception
|
||||
*
|
||||
* \param message - text description of the error, most of the times contains the result of <a class="el" href="http://www.lmdb.tech/doc/group__mdb.html#ga569e66c1e3edc1a6016b86719ee3d098">mdb_strerror</a>
|
||||
* \param dbName - name of the database
|
||||
* \param tableName - name of the storage that was operated with, abscent if the operation was with the database itself
|
||||
*/
|
||||
Unknown(const std::string& dbName, const std::string& message, const std::optional<std::string>& tableName = std::nullopt);
|
||||
|
||||
std::string getMessage() const;
|
||||
|
@ -75,21 +75,23 @@ QDataStream& operator >> (QDataStream &in, std::multimap<K, V>& container) {
|
||||
return in;
|
||||
}
|
||||
|
||||
// template <class K, class V>
|
||||
// QDataStream& operator << (QDataStream &out, const std::pair<K, V>& pair) {
|
||||
// out << pair.first;
|
||||
// out << pair.second;
|
||||
//
|
||||
// return out;
|
||||
// }
|
||||
//
|
||||
// template <class K, class V>
|
||||
// QDataStream& operator >> (QDataStream &in, std::pair<K, V>& container) {
|
||||
// in >> container.first;
|
||||
// in >> container.second;
|
||||
//
|
||||
// return in;
|
||||
// }
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
template <class K, class V>
|
||||
QDataStream& operator << (QDataStream &out, const std::pair<K, V>& pair) {
|
||||
out << pair.first;
|
||||
out << pair.second;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
template <class K, class V>
|
||||
QDataStream& operator >> (QDataStream &in, std::pair<K, V>& container) {
|
||||
in >> container.first;
|
||||
in >> container.second;
|
||||
|
||||
return in;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class K>
|
||||
QDataStream& operator << (QDataStream &out, const std::set<K>& container) {
|
||||
|
Loading…
Reference in New Issue
Block a user