aboutsummaryrefslogtreecommitdiff
path: root/include/odhtdb/Group.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-14 00:20:11 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit8b94c3bf3a06caa7b003fe61e8242bdb00004eb5 (patch)
treec307bf3a9c1bf38ea23608b0700755fc76e6980e /include/odhtdb/Group.hpp
parent0c8761b3d76912f034a0cb819d72f0349a25bf4f (diff)
Replace files with sqlite
Using sqlite because sqlite has transactions, storing/loading from files automatically, unloading data that is not accessed often. Removed cosmetic data (node name, username). They can be added using addData by the application that uses odhtdb instead. Database callback functions can now be called with stored data using database.loadNode function. TODO: Add local user storage (with password) back, it has been temorary disabled
Diffstat (limited to 'include/odhtdb/Group.hpp')
-rw-r--r--include/odhtdb/Group.hpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/include/odhtdb/Group.hpp b/include/odhtdb/Group.hpp
index 99307e1..f8de78e 100644
--- a/include/odhtdb/Group.hpp
+++ b/include/odhtdb/Group.hpp
@@ -4,7 +4,6 @@
#include "DataView.hpp"
#include "Permission.hpp"
#include "utils.hpp"
-#include <string>
#include <vector>
#include <stdexcept>
@@ -12,16 +11,6 @@ namespace odhtdb
{
class User;
- class GroupNameTooLongException : public std::runtime_error
- {
- public:
- GroupNameTooLongException(const std::string &groupName) :
- std::runtime_error(std::string("The group name ") + groupName + " is longer than 255 bytes")
- {
-
- }
- };
-
const int GROUP_ID_LENGTH = 16;
class Group
@@ -29,10 +18,9 @@ namespace odhtdb
DISABLE_COPY(Group)
friend class User;
public:
- Group(const std::string &name, uint8_t id[GROUP_ID_LENGTH], const Permission &permission);
+ Group(uint8_t id[GROUP_ID_LENGTH], const Permission &permission);
~Group();
- const std::string& getName() const;
DataView getId() const;
const Permission& getPermission() const;
const std::vector<const User*>& getUsers() const;
@@ -40,7 +28,6 @@ namespace odhtdb
void addUser(const User *user);
bool removeUser(const User *user);
private:
- std::string name;
uint8_t id[GROUP_ID_LENGTH];
Permission permission;
std::vector<const User*> users;