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)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(LMDBAL
|
project(LMDBAL
|
||||||
VERSION 0.3.0
|
VERSION 0.3.1
|
||||||
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
|
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Maintainer: Yury Gubich <blue@macaw.me>
|
# Maintainer: Yury Gubich <blue@macaw.me>
|
||||||
pkgname=lmdbal
|
pkgname=lmdbal
|
||||||
pkgver=0.3.0
|
pkgver=0.3.1
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="LMDB Abstraction Layer, qt5 version"
|
pkgdesc="LMDB Abstraction Layer, qt5 version"
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
@ -11,7 +11,7 @@ makedepends=('cmake>=3.16')
|
|||||||
optdepends=()
|
optdepends=()
|
||||||
|
|
||||||
source=("$pkgname-$pkgver.tar.gz::https://git.macaw.me/blue/lmdbal/archive/$pkgver.tar.gz")
|
source=("$pkgname-$pkgver.tar.gz::https://git.macaw.me/blue/lmdbal/archive/$pkgver.tar.gz")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('df1a9687d81d609d160754285f2613d7e07fc6deb781d0fb0084e4857ea82e95')
|
||||||
build() {
|
build() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/$pkgname"
|
||||||
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release -D QT_VERSION_MAJOR=5
|
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release -D QT_VERSION_MAJOR=5
|
||||||
@ -19,5 +19,5 @@ build() {
|
|||||||
}
|
}
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/$pkgname"
|
||||||
cmake --install . --prefix $pkgdir/
|
DESTDIR="$pkgdir/" cmake --install .
|
||||||
}
|
}
|
||||||
|
@ -25,18 +25,29 @@
|
|||||||
|
|
||||||
namespace LMDBAL {
|
namespace LMDBAL {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Parent abstract class for all LMDBAL exceptions
|
||||||
|
*/
|
||||||
class Exception : public std::exception {
|
class Exception : public std::exception {
|
||||||
public:
|
public:
|
||||||
Exception();
|
Exception();
|
||||||
virtual ~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 {
|
class Directory: public Exception {
|
||||||
public:
|
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);
|
Directory(const std::string& path);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
@ -44,9 +55,19 @@ private:
|
|||||||
std::string path;
|
std::string path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Thrown if something in the database was called on closed state and it is not supported
|
||||||
|
*/
|
||||||
class Closed : public Exception {
|
class Closed : public Exception {
|
||||||
public:
|
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;
|
std::string getMessage() const;
|
||||||
private:
|
private:
|
||||||
@ -55,8 +76,17 @@ private:
|
|||||||
std::optional<std::string> tableName;
|
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 {
|
class Opened : Exception {
|
||||||
public:
|
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);
|
Opened(const std::string& dbName, const std::string& action);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
@ -65,8 +95,18 @@ private:
|
|||||||
std::string action;
|
std::string action;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Thrown if something in the database was not found
|
||||||
|
*/
|
||||||
class NotFound : public Exception {
|
class NotFound : public Exception {
|
||||||
public:
|
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);
|
NotFound(const std::string& key, const std::string& dbName, const std::string& tableName);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
@ -76,8 +116,17 @@ private:
|
|||||||
std::string tableName;
|
std::string tableName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Thrown if there was attempt to define storages with conflicting names
|
||||||
|
*/
|
||||||
class StorageDuplicate : public Exception {
|
class StorageDuplicate : public Exception {
|
||||||
public:
|
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);
|
StorageDuplicate(const std::string& dbName, const std::string& tableName);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
@ -86,8 +135,18 @@ private:
|
|||||||
std::string tableName;
|
std::string tableName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Thrown if there was a key conflict in one of the storages
|
||||||
|
*/
|
||||||
class Exist : public Exception {
|
class Exist : public Exception {
|
||||||
public:
|
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);
|
Exist(const std::string& key, const std::string& dbName, const std::string& tableName);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
@ -97,8 +156,18 @@ private:
|
|||||||
std::string tableName;
|
std::string tableName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Thrown if something unexpected happened
|
||||||
|
*/
|
||||||
class Unknown : public Exception {
|
class Unknown : public Exception {
|
||||||
public:
|
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);
|
Unknown(const std::string& dbName, const std::string& message, const std::optional<std::string>& tableName = std::nullopt);
|
||||||
|
|
||||||
std::string getMessage() const;
|
std::string getMessage() const;
|
||||||
|
@ -75,21 +75,23 @@ QDataStream& operator >> (QDataStream &in, std::multimap<K, V>& container) {
|
|||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
// template <class K, class V>
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
// QDataStream& operator << (QDataStream &out, const std::pair<K, V>& pair) {
|
template <class K, class V>
|
||||||
// out << pair.first;
|
QDataStream& operator << (QDataStream &out, const std::pair<K, V>& pair) {
|
||||||
// out << pair.second;
|
out << pair.first;
|
||||||
//
|
out << pair.second;
|
||||||
// return out;
|
|
||||||
// }
|
return out;
|
||||||
//
|
}
|
||||||
// template <class K, class V>
|
|
||||||
// QDataStream& operator >> (QDataStream &in, std::pair<K, V>& container) {
|
template <class K, class V>
|
||||||
// in >> container.first;
|
QDataStream& operator >> (QDataStream &in, std::pair<K, V>& container) {
|
||||||
// in >> container.second;
|
in >> container.first;
|
||||||
//
|
in >> container.second;
|
||||||
// return in;
|
|
||||||
// }
|
return in;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
QDataStream& operator << (QDataStream &out, const std::set<K>& container) {
|
QDataStream& operator << (QDataStream &out, const std::set<K>& container) {
|
||||||
|
Loading…
Reference in New Issue
Block a user