Resolve "Prepare chaiscript bindings for current code"
This commit is contained in:
parent
e4b595c0be
commit
818c7f6e10
@ -9,7 +9,10 @@ set(${PKG_CONFIG_USE_CMAKE_PREFIX_PATH} ON)
|
||||
pkg_check_modules(chaiscript REQUIRED)
|
||||
|
||||
# create library
|
||||
add_library(${LIB} src/chai_bindings.cpp)
|
||||
add_library(${LIB}
|
||||
src/chai_bindings.cpp
|
||||
include/eedb/chai/chai_bindings.hpp
|
||||
)
|
||||
|
||||
# link all
|
||||
target_include_directories(${LIB}
|
||||
|
||||
@ -2,19 +2,20 @@
|
||||
|
||||
#include <chaiscript/dispatchkit/bootstrap.hpp>
|
||||
#include <chaiscript/dispatchkit/bootstrap_stl.hpp>
|
||||
|
||||
#include <chaiscript/utility/utility.hpp>
|
||||
|
||||
#include <eedb/Category.hpp>
|
||||
|
||||
#include <eedb/AuthIdentities.hpp>
|
||||
#include <eedb/AuthInfo.hpp>
|
||||
#include <eedb/AuthToken.hpp>
|
||||
#include <eedb/AuthTokens.hpp>
|
||||
#include <eedb/Category.hpp>
|
||||
#include <eedb/Factory.hpp>
|
||||
#include <eedb/Item.hpp>
|
||||
#include <eedb/Parameter.hpp>
|
||||
#include <eedb/Unit.hpp>
|
||||
#include <eedb/User.hpp>
|
||||
#include <eedb/Users.hpp>
|
||||
|
||||
#include <eedb/Factory.hpp>
|
||||
#include <eedb/Value.hpp>
|
||||
|
||||
void eedb::script::chai_bootstrap(chaiscript::Module & module) {
|
||||
using namespace chaiscript;
|
||||
@ -25,25 +26,35 @@ void eedb::script::chai_bootstrap(chaiscript::Module & module) {
|
||||
* CATEGORY
|
||||
*******************/
|
||||
|
||||
module.add(user_type< CategoriesRepository >(), "CategoriesRepository");
|
||||
module.add(fun(&CategoriesRepository::create), "create");
|
||||
module.add(fun(&CategoriesRepository::root), "root");
|
||||
chaiscript::utility::add_class< CategoriesRepository >(module, //
|
||||
"CategoriesRepository",
|
||||
{}, //
|
||||
{
|
||||
{fun(&CategoriesRepository::create), "create"}, //
|
||||
{fun(&CategoriesRepository::root), "root"} //
|
||||
});
|
||||
|
||||
module.add(user_type< exceptions::CategoryAddException >(), "CategoryAddException");
|
||||
// module.add(constructor< exceptions::CategoryAddException(std::unique_ptr< Category >) >(), "CategoryAddException");
|
||||
module.add(fun(&exceptions::CategoryAddException::what), "what");
|
||||
chaiscript::utility::add_class< exceptions::CategoryAddException >(module,
|
||||
"CategoryAddException",
|
||||
{
|
||||
{constructor< exceptions::CategoryAddException(std::unique_ptr< Category > &&, std::string) >()} //
|
||||
},
|
||||
{
|
||||
{fun(&exceptions::CategoryAddException::get), "get"}, //
|
||||
{fun(&exceptions::CategoryAddException::what), "what"} //
|
||||
});
|
||||
|
||||
chaiscript::utility::add_class< Category >(module,
|
||||
"Category",
|
||||
{},
|
||||
{//
|
||||
{
|
||||
{fun(&Category::addChild), "addChild"},
|
||||
{fun(&Category::attachTo), "attachTo"},
|
||||
{fun(&Category::children), "children"},
|
||||
{fun(&Category::detach), "detach"},
|
||||
{fun(&Category::displayName), "displayName"},
|
||||
{fun(&Category::parent), "parent"}});
|
||||
|
||||
{fun(&Category::parent), "parent"} //
|
||||
});
|
||||
|
||||
module.add(user_type< CategoriesChildren >(), "CategoriesChildren");
|
||||
bootstrap::standard_library::input_range_type< CategoriesChildren >("CategoriesChildren", module);
|
||||
@ -64,8 +75,9 @@ void eedb::script::chai_bootstrap(chaiscript::Module & module) {
|
||||
chaiscript::utility::add_class< AuthIdentities >(module,
|
||||
"AuthIdentities",
|
||||
{},
|
||||
{//
|
||||
{fun(&AuthIdentities::removeProvider), "removeProvider"}});
|
||||
{
|
||||
{fun(&AuthIdentities::removeProvider), "removeProvider"} //
|
||||
});
|
||||
|
||||
/********************
|
||||
* FACTORY
|
||||
@ -74,8 +86,9 @@ void eedb::script::chai_bootstrap(chaiscript::Module & module) {
|
||||
chaiscript::utility::add_class< Factory >(module,
|
||||
"Factory",
|
||||
{},
|
||||
{//
|
||||
{fun(&Factory::categoriesRepository), "categoriesRepository"}});
|
||||
|
||||
// module.add(fun(&Factory::itemsRepository), "itemsRepository");
|
||||
{
|
||||
//
|
||||
{fun(&Factory::categoriesRepository), "categoriesRepository"},
|
||||
{fun(&Factory::itemsRepository), "itemsRepository"} //
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,6 +1,27 @@
|
||||
set(LIB postgres_connector)
|
||||
|
||||
file(GLOB ${LIB}_SOURCE src/*)
|
||||
set(HEADERS
|
||||
./include/eedb/pg/AuthIdentity.hpp
|
||||
./include/eedb/pg/Parameter.hpp
|
||||
./include/eedb/pg/Users.hpp
|
||||
./include/eedb/pg/config.hpp
|
||||
./include/eedb/pg/User.hpp
|
||||
./include/eedb/pg/AuthToken.hpp
|
||||
./include/eedb/pg/Item.hpp
|
||||
./include/eedb/pg/ItemsRepository.hpp
|
||||
./include/eedb/pg/Session.hpp
|
||||
./include/eedb/pg/Items.hpp
|
||||
./include/eedb/pg/Factory.hpp
|
||||
./include/eedb/pg/connection.hpp
|
||||
./include/eedb/pg/RawSql.hpp
|
||||
./include/eedb/pg/Stats.hpp
|
||||
./include/eedb/pg/Category.hpp
|
||||
./include/eedb/pg/CategoriesRepository.hpp
|
||||
./include/eedb/pg/utils.hpp
|
||||
./include/eedb/pg/ParametersRepository.hpp
|
||||
)
|
||||
|
||||
file(GLOB SOURCES src/*)
|
||||
|
||||
# find packages
|
||||
find_package(Sqlpp11 REQUIRED)
|
||||
@ -8,7 +29,8 @@ find_package(Sqlpp-connector-postgresql REQUIRED)
|
||||
|
||||
# create library
|
||||
add_library(${LIB} STATIC
|
||||
${${LIB}_SOURCE}
|
||||
${SOURCES}
|
||||
${HEADERS}
|
||||
)
|
||||
|
||||
# link all
|
||||
@ -53,5 +75,6 @@ set_target_properties(${LIB}
|
||||
)
|
||||
cotire(${LIB})
|
||||
|
||||
add_subdirectory(include/eedb/pg/model)
|
||||
add_subdirectory(mock)
|
||||
add_subdirectory(test)
|
||||
|
||||
@ -17,9 +17,9 @@ class AuthIdentityImpl final : public AuthIdentity {
|
||||
AuthIdentityImpl(Connection & db, std::string identity, std::string provider);
|
||||
// PgAuthIdentity(Connection & db, nlohmann::json data);
|
||||
|
||||
string_view identity() const override;
|
||||
std::string_view identity() const override;
|
||||
|
||||
string_view provider() const override;
|
||||
std::string_view provider() const override;
|
||||
|
||||
private:
|
||||
struct PgAuthIdentityPriv;
|
||||
|
||||
@ -48,7 +48,7 @@ class CategoryImpl : public impl::PgCategory {
|
||||
// creates category from private data
|
||||
CategoryImpl(spimpl::unique_impl_ptr< CategoryImplPrivate > && priv);
|
||||
|
||||
string_view displayName() const override;
|
||||
std::string_view displayName() const override;
|
||||
|
||||
Category * parent() const override;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ class ItemImpl : public Item {
|
||||
|
||||
CategoriesIt attachedToCategories() const override;
|
||||
|
||||
bool attach(const Category * category) override;
|
||||
void attach(const Category * category) override;
|
||||
|
||||
private:
|
||||
struct ItemPriv;
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
set(HEADERS
|
||||
./unit.h
|
||||
./auth_info.h
|
||||
./parameter.h
|
||||
./item.h
|
||||
./system_info.h
|
||||
./stat.h
|
||||
./user_audit.h
|
||||
./category_items.h
|
||||
./file.h
|
||||
./category.h
|
||||
./auth_token.h
|
||||
./group.h
|
||||
./all.hpp
|
||||
./auth_identity.h
|
||||
)
|
||||
|
||||
add_custom_target(postgresql_model-ide SOURCES ${HEADERS})
|
||||
@ -1,8 +1,31 @@
|
||||
set(LIB postgres_connector-mock)
|
||||
|
||||
set(HEADERS
|
||||
./include/eedb/mock/db/pg/ParameterMock.hpp
|
||||
./include/eedb/mock/db/pg/SignalBaseMock.hpp
|
||||
./include/eedb/mock/db/pg/AuthIdentitiesMock.hpp
|
||||
./include/eedb/mock/db/pg/ItemsMock.hpp
|
||||
./include/eedb/mock/db/pg/ItemQueryFiltersMock.hpp
|
||||
./include/eedb/mock/db/pg/UserMock.hpp
|
||||
./include/eedb/mock/db/pg/SessionMock.hpp
|
||||
./include/eedb/mock/db/pg/AuthTokenMock.hpp
|
||||
./include/eedb/mock/db/pg/ParametersRepositoryMock.hpp
|
||||
./include/eedb/mock/db/pg/UserNameMock.hpp
|
||||
./include/eedb/mock/db/pg/CategoryMock.hpp
|
||||
./include/eedb/mock/db/pg/CategoriesMock.hpp
|
||||
./include/eedb/mock/db/pg/ItemMock.hpp
|
||||
./include/eedb/mock/db/pg/AuthInfoMock.hpp
|
||||
./include/eedb/mock/db/pg/AuthTokensMock.hpp
|
||||
./include/eedb/mock/db/pg/CategoriesRepositoryMock.hpp
|
||||
./include/eedb/mock/db/pg/UsersMock.hpp
|
||||
)
|
||||
|
||||
# create library
|
||||
add_library(${LIB} INTERFACE)
|
||||
|
||||
# make ide happy
|
||||
add_custom_target(${LIB}_ide SOURCES ${HEADERS})
|
||||
|
||||
# link all
|
||||
target_include_directories(${LIB} INTERFACE
|
||||
include
|
||||
|
||||
@ -21,11 +21,11 @@ struct AuthIdentityImpl::PgAuthIdentityPriv {
|
||||
AuthIdentityImpl::AuthIdentityImpl(Connection & db, std::string identity, std::string provider)
|
||||
: _priv{spimpl::make_unique_impl< PgAuthIdentityPriv >(db, identity, provider)} {}
|
||||
|
||||
AuthIdentity::string_view AuthIdentityImpl::identity() const {
|
||||
std::string_view AuthIdentityImpl::identity() const {
|
||||
return _priv->identity;
|
||||
}
|
||||
|
||||
AuthIdentity::string_view AuthIdentityImpl::provider() const {
|
||||
std::string_view AuthIdentityImpl::provider() const {
|
||||
return _priv->provider;
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +209,7 @@ CategoryImpl::CategoryImpl(spimpl::unique_impl_ptr< CategoryImplPrivate > && pri
|
||||
_priv->_self = this;
|
||||
}
|
||||
|
||||
Category::string_view CategoryImpl::displayName() const {
|
||||
std::string_view CategoryImpl::displayName() const {
|
||||
return _priv->displayName();
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +47,8 @@ Item::CategoriesIt ItemImpl::attachedToCategories() const {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ItemImpl::attach(const Category * category) {
|
||||
return _priv->attachToCategory(category);
|
||||
void ItemImpl::attach(const Category * category) {
|
||||
_priv->attachToCategory(category);
|
||||
}
|
||||
|
||||
} // namespace eedb::pg
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
|
||||
SQLPP_ALIAS_PROVIDER(_match);
|
||||
SQLPP_ALIAS_PROVIDER(_match)
|
||||
|
||||
namespace eedb::pg {
|
||||
struct ItemsRepositoryImpl::temsRepositoryImplPriv {
|
||||
|
||||
@ -55,7 +55,7 @@ class DockerRunner {
|
||||
"POSTGRES_PASSWORD=postgres",
|
||||
"-e",
|
||||
"POSTGRES_DB=eedb",
|
||||
"postgres:9.6-alpine");
|
||||
"postgres:latest");
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ class DbTestBase : public testing::Test {
|
||||
static void SetUpTestCase() {
|
||||
_test_db = std::make_unique< PgTestDatabasePrepare >();
|
||||
_test_db->db().execute("SET synchronous_commit=off;");
|
||||
eedb::pg::exec_file(_test_db->db(), "/home/wieczbar/src/eedb/sql/schema.sql");
|
||||
eedb::pg::exec_file(_test_db->db(), "/home/bwieczor/src/eedb/sql/schema.sql");
|
||||
}
|
||||
|
||||
static void TearDownTestCase() {
|
||||
|
||||
@ -1,11 +1,36 @@
|
||||
set(LIB eedb_api)
|
||||
|
||||
set(HEADERS
|
||||
./include/eedb/AuthIdentity.hpp
|
||||
./include/eedb/Parameter.hpp
|
||||
./include/eedb/AuthIdentitiesConst.hpp
|
||||
./include/eedb/AuthInfoConst.hpp
|
||||
./include/eedb/Users.hpp
|
||||
./include/eedb/User.hpp
|
||||
./include/eedb/AuthToken.hpp
|
||||
./include/eedb/Password.hpp
|
||||
./include/eedb/AuthIdentities.hpp
|
||||
./include/eedb/Item.hpp
|
||||
./include/eedb/Session.hpp
|
||||
./include/eedb/AuthInfo.hpp
|
||||
./include/eedb/Factory.hpp
|
||||
./include/eedb/Value.hpp
|
||||
./include/eedb/Unit.hpp
|
||||
./include/eedb/Category.hpp
|
||||
./include/eedb/AuthTokens.hpp
|
||||
./include/eedb/AuthIdentityConst.hpp
|
||||
./include/eedb/Email.hpp
|
||||
)
|
||||
|
||||
# find packages
|
||||
find_package(nlohmann_json CONFIG REQUIRED)
|
||||
|
||||
# create library
|
||||
add_library(${LIB} INTERFACE)
|
||||
|
||||
# make ide happy
|
||||
add_custom_target(${LIB}_ide SOURCES ${HEADERS})
|
||||
|
||||
# link all
|
||||
target_include_directories(${LIB}
|
||||
INTERFACE include
|
||||
|
||||
@ -16,8 +16,17 @@ class AuthIdentities {
|
||||
*/
|
||||
virtual AuthIdentity * addIdentity(std::unique_ptr< AuthIdentity > identity) = 0;
|
||||
|
||||
/**
|
||||
* @brief byProvider
|
||||
* @param provider
|
||||
* @return
|
||||
*/
|
||||
virtual AuthIdentity * byProvider(std::string_view provider) const = 0;
|
||||
|
||||
/**
|
||||
* @brief removeProvider
|
||||
* @param provider
|
||||
*/
|
||||
virtual void removeProvider(std::string_view provider) = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -6,6 +6,10 @@ namespace eebd {
|
||||
|
||||
class AuthIdentity;
|
||||
|
||||
/**
|
||||
* @brief The AuthIdentitiesConst class
|
||||
* Immutable implementation of identities
|
||||
*/
|
||||
class AuthIdentitiesConst final : public AuthIdentities {
|
||||
public:
|
||||
AuthIdentitiesConst(std::initializer_list< AuthIdentityConst > identities) {
|
||||
|
||||
@ -6,15 +6,20 @@
|
||||
namespace eedb {
|
||||
|
||||
class AuthIdentity {
|
||||
protected:
|
||||
using string_view = std::string_view;
|
||||
using string = std::string;
|
||||
|
||||
public:
|
||||
virtual ~AuthIdentity() = default;
|
||||
|
||||
virtual string_view identity() const = 0;
|
||||
virtual string_view provider() const = 0;
|
||||
/**
|
||||
* @brief identity
|
||||
* @return string representation of identity (e.g. einstein)
|
||||
*/
|
||||
virtual std::string_view identity() const = 0;
|
||||
|
||||
/**
|
||||
* @brief provider
|
||||
* @return a string key of provider for identity (e.g. facebook"
|
||||
*/
|
||||
virtual std::string_view provider() const = 0;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@ -3,22 +3,24 @@
|
||||
#include <eedb/AuthIdentity.hpp>
|
||||
|
||||
namespace eedb {
|
||||
/**
|
||||
* @brief The AuthIdentityConst class
|
||||
* This is an immutable version of AuthIdentity class
|
||||
*/
|
||||
class AuthIdentityConst final : public AuthIdentity {
|
||||
protected:
|
||||
using string_view = std::string_view;
|
||||
using string = std::string;
|
||||
public:
|
||||
AuthIdentityConst(std::string identity, std::string provider) : _identity{std::move(identity)}, _provider{std::move(provider)} {}
|
||||
|
||||
public:
|
||||
AuthIdentityConst(string identity, string provider) : _identity{std::move(identity)}, _provider{std::move(provider)} {}
|
||||
virtual string_view identity() const override {
|
||||
virtual std::string_view identity() const override {
|
||||
return _identity;
|
||||
}
|
||||
virtual string_view provider() const override {
|
||||
|
||||
virtual std::string_view provider() const override {
|
||||
return _provider;
|
||||
}
|
||||
|
||||
private:
|
||||
string _identity;
|
||||
string _provider;
|
||||
private:
|
||||
std::string _identity;
|
||||
std::string _provider;
|
||||
};
|
||||
}
|
||||
} // namespace eedb
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
#include <any_iterator/any_iterator.hpp>
|
||||
|
||||
namespace eedb {
|
||||
|
||||
class Category;
|
||||
|
||||
class CategoriesRepository {
|
||||
@ -41,10 +40,10 @@ namespace exceptions {
|
||||
class CategoryAddException : public std::logic_error {
|
||||
// exception interface
|
||||
public:
|
||||
CategoryAddException(std::unique_ptr< Category > category, std::string reason)
|
||||
CategoryAddException(std::unique_ptr< Category > && category, std::string reason)
|
||||
: std::logic_error(std::move(reason)), _badCategory{std::move(category)} {}
|
||||
|
||||
std::unique_ptr< Category > get() {
|
||||
auto get() {
|
||||
return std::move(_badCategory);
|
||||
}
|
||||
|
||||
@ -64,11 +63,9 @@ class CategoriesChildren : public details::CategoryPtrIteratorRange {
|
||||
|
||||
/**
|
||||
* @brief The Category class
|
||||
* Categories are organized in a tree like hierarchy where each category has own id and parent
|
||||
*/
|
||||
class Category {
|
||||
public:
|
||||
using string_view = std::string_view;
|
||||
|
||||
public:
|
||||
virtual ~Category() = default;
|
||||
|
||||
@ -76,7 +73,7 @@ class Category {
|
||||
* @brief displayName
|
||||
* @return category display name
|
||||
*/
|
||||
virtual string_view displayName() const = 0;
|
||||
virtual std::string_view displayName() const = 0;
|
||||
|
||||
/**
|
||||
* @brief parent
|
||||
@ -86,7 +83,7 @@ class Category {
|
||||
|
||||
/**
|
||||
* @brief addChild
|
||||
* @param category
|
||||
* @param category that should be added to this category
|
||||
* @throws CategoryAddException()
|
||||
* @return pointer to newely added category
|
||||
*/
|
||||
|
||||
@ -49,6 +49,12 @@ class ItemQueryFilters {
|
||||
};
|
||||
|
||||
namespace item {
|
||||
namespace exception{
|
||||
///TODO FIX
|
||||
class ItemAlreadyInCategory : public std::exception{
|
||||
|
||||
};
|
||||
}
|
||||
using Iterator = IteratorTypeErasure::any_iterator< std::unique_ptr< Item >, std::forward_iterator_tag, std::unique_ptr< Item > >;
|
||||
using IteratorRange = boost::iterator_range< Iterator >;
|
||||
|
||||
@ -56,11 +62,11 @@ namespace item {
|
||||
public:
|
||||
Identyfier(std::string symbol, std::string producer_symbol = {}) : _sym{std::move(symbol)}, _prod{std::move(producer_symbol)} {}
|
||||
|
||||
std::string_view symbol() const {
|
||||
std::string_view symbol() const noexcept {
|
||||
return _sym;
|
||||
}
|
||||
|
||||
std::string_view producerSymbol() const {
|
||||
std::string_view producerSymbol() const noexcept {
|
||||
return _prod.empty() ? _sym : _prod;
|
||||
}
|
||||
|
||||
@ -69,6 +75,10 @@ namespace item {
|
||||
std::string _prod;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The Attributes class
|
||||
* Attributes of item saved in database e.g.
|
||||
*/
|
||||
class Attributes {
|
||||
public:
|
||||
using Mass = boost::units::quantity< boost::units::si::mass >;
|
||||
@ -174,27 +184,27 @@ class Item {
|
||||
|
||||
/**
|
||||
* @brief displayName
|
||||
* @return
|
||||
* @return name of item
|
||||
*/
|
||||
virtual std::string_view displayName() const = 0;
|
||||
|
||||
/**
|
||||
* @brief assignedUnits
|
||||
* @return
|
||||
* @return values stored in this item
|
||||
*/
|
||||
virtual Values values() const = 0;
|
||||
|
||||
/**
|
||||
* @brief attachedToCategories
|
||||
* @return
|
||||
* @return return list of categories that this item applies to
|
||||
*/
|
||||
virtual CategoriesIt attachedToCategories() const = 0;
|
||||
|
||||
/**
|
||||
* @brief attach
|
||||
* @brief attach attach to given category
|
||||
* @param category
|
||||
* @return
|
||||
* @throw
|
||||
*/
|
||||
virtual bool attach(const Category * category) = 0;
|
||||
virtual void attach(const Category * category) noexcept(false)= 0;
|
||||
};
|
||||
} // namespace eedb
|
||||
|
||||
@ -16,13 +16,29 @@ class AuthIdentity;
|
||||
class User {
|
||||
public:
|
||||
virtual ~User() = default;
|
||||
|
||||
/**
|
||||
* @brief config
|
||||
* @returnvalid user config object
|
||||
*/
|
||||
virtual const UserConfig & config() const = 0;
|
||||
|
||||
/**
|
||||
* user auth token
|
||||
* authorization tokens
|
||||
*/
|
||||
virtual AuthTokens & authTokens() const = 0;
|
||||
|
||||
/**
|
||||
* @brief authIdentities
|
||||
* @return user identities
|
||||
*/
|
||||
virtual AuthIdentities & authIdentities() const = 0;
|
||||
|
||||
/**
|
||||
* @brief authInfo
|
||||
* @return auth info
|
||||
*/
|
||||
virtual AuthInfo & authInfo() const = 0;
|
||||
};
|
||||
|
||||
} // namespace eedb
|
||||
|
||||
@ -1,8 +1,30 @@
|
||||
set(LIB eedb_api-mock)
|
||||
|
||||
set(HEADERS
|
||||
./include/eedb/mock/db/ParameterMock.hpp
|
||||
./include/eedb/mock/db/SignalBaseMock.hpp
|
||||
./include/eedb/mock/db/AuthIdentitiesMock.hpp
|
||||
./include/eedb/mock/db/ItemsMock.hpp
|
||||
./include/eedb/mock/db/ItemQueryFiltersMock.hpp
|
||||
./include/eedb/mock/db/UserMock.hpp
|
||||
./include/eedb/mock/db/SessionMock.hpp
|
||||
./include/eedb/mock/db/AuthTokenMock.hpp
|
||||
./include/eedb/mock/db/ParametersRepositoryMock.hpp
|
||||
./include/eedb/mock/db/UserNameMock.hpp
|
||||
./include/eedb/mock/db/CategoryMock.hpp
|
||||
./include/eedb/mock/db/CategoriesMock.hpp
|
||||
./include/eedb/mock/db/ItemMock.hpp
|
||||
./include/eedb/mock/db/AuthInfoMock.hpp
|
||||
./include/eedb/mock/db/AuthTokensMock.hpp
|
||||
./include/eedb/mock/db/UsersMock.hpp
|
||||
)
|
||||
|
||||
# create library
|
||||
add_library(${LIB} INTERFACE)
|
||||
|
||||
# make ide happy
|
||||
add_custom_target(${LIB}_ide SOURCES ${HEADERS})
|
||||
|
||||
# link all
|
||||
target_include_directories(${LIB} INTERFACE
|
||||
include
|
||||
|
||||
@ -9,7 +9,7 @@ class CategoryMock : public Category {
|
||||
public:
|
||||
// Category interface
|
||||
public:
|
||||
MOCK_CONST_METHOD0(displayName, string_view());
|
||||
MOCK_CONST_METHOD0(displayName, std::string_view());
|
||||
MOCK_CONST_METHOD0(parent, Category *());
|
||||
MOCK_METHOD1(doAddChild, Category *( Category * ) );
|
||||
Category * addChild(std::unique_ptr< Category > && c) {
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
namespace eedb {
|
||||
|
||||
struct DefaultAuthPage::DefaultAuthPagePriv {
|
||||
|
||||
auto dumpEnvironment() const {
|
||||
const auto & env = Wt::WApplication::instance()->environment();
|
||||
auto getEnvironment = [](const Wt::WEnvironment & env) {
|
||||
@ -28,6 +27,7 @@ struct DefaultAuthPage::DefaultAuthPagePriv {
|
||||
case Wt::HtmlContentType::HTML5:
|
||||
return "HTML5";
|
||||
}
|
||||
return "Unknown";
|
||||
};
|
||||
|
||||
auto getCookies = [](const Wt::WEnvironment & env) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user