From 6ca6e0812eb3d6b8eceeb8a62a05bd994f9064bd Mon Sep 17 00:00:00 2001 From: Mu-Woong Lee Date: Fri, 10 Feb 2017 13:11:11 +0900 Subject: [PATCH] Add a Database constructor accepting the const reference of Credential Change-Id: I0ebfdd8bd9d0a5b971bf454df07e08d20bf7a947 Signed-off-by: Mu-Woong Lee --- include/Database.h | 1 + src/server/Database.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/Database.h b/include/Database.h index 0e7cf64..cd53a12 100644 --- a/include/Database.h +++ b/include/Database.h @@ -35,6 +35,7 @@ namespace ctx { class EXPORT_API Database { public: Database(const std::string& dbName, uid_t uid); + Database(const std::string& dbName, const Credential& credential); Database(const std::string& dbName, const Credential* credential); Database(const std::string& dbName); diff --git a/src/server/Database.cpp b/src/server/Database.cpp index cdcb8ea..5e13348 100644 --- a/src/server/Database.cpp +++ b/src/server/Database.cpp @@ -76,6 +76,11 @@ Database::Database(const std::string& dbName, uid_t uid) : _I("Path: %s", __dbPath.c_str()); } +Database::Database(const std::string& dbName, const Credential& credential) : + Database(dbName, credential.getUid()) +{ +} + Database::Database(const std::string& dbName, const Credential* credential) : Database(dbName, credential->getUid()) { -- 2.7.4