Skip to content
Snippets Groups Projects
Commit ea88efc2 authored by florian's avatar florian
Browse files

WIP: Remove code unnecessary for the bug report

parent 1d0944e3
No related branches found
No related tags found
No related merge requests found
Pipeline #10106 failed
......@@ -25,40 +25,9 @@
#include <jlcxx/jlcxx.hpp>
#include "caosdb/authentication.h"
#include "caosdb/connection.h"
#include "caosdb/constants.h"
#include "caosdb/exceptions.h"
namespace jlcxx
{
template<>
struct SuperType<caosdb::authentication::PlainPasswordAuthenticator>
{
typedef caosdb::authentication::Authenticator type;
};
}
JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
{
// Version info of libcaosdb against which this is built.
mod.method("get_libcaosdb_version_major", []() {return caosdb::LIBCAOSDB_VERSION_MAJOR;});
mod.method("get_libcaosdb_version_minor", []() {return caosdb::LIBCAOSDB_VERSION_MINOR;});
mod.method("get_libcaosdb_version_patch", []() {return caosdb::LIBCAOSDB_VERSION_PATCH;});
// exceptions inherit from abstract Julia exception types:
mod.add_type<caosdb::exceptions::AuthenticationError>("AuthenticationError",
jlcxx::julia_type("AbstractAuthenticationError"))
.constructor<const std::string&>()
.method("what", &caosdb::exceptions::AuthenticationError::what);
mod.add_type<caosdb::exceptions::ConnectionError>("ConnectionError",
jlcxx::julia_type("AbstractConnectionError"))
.constructor<const std::string&>()
.method("what", &caosdb::exceptions::ConnectionError::what);
// authenticators
mod.add_type<caosdb::authentication::Authenticator>("CaosDBAuthenticator");
mod.add_type<caosdb::authentication::PlainPasswordAuthenticator>("PlainPasswordAuthenticator",
jlcxx::julia_base_type<caosdb::authentication::Authenticator>())
.constructor<const std::string&, const std::string&>()
.method("getCallCredentials", &caosdb::authentication::PlainPasswordAuthenticator::getCallCredentials);
mod.add_type<caosdb::authentication::PlainPasswordAuthenticator>("PlainPasswordAuthenticator");
}
......@@ -5,14 +5,6 @@ module CaosDB
using CxxWrap
"Generic super type of CaosDB exceptions"
abstract type AbstractCaosDBException <: Exception end
"An error occurred while trying to authenticate"
abstract type AbstractAuthenticationError <: AbstractCaosDBException end
"Connection couldn't be established"
abstract type AbstractConnectionError <: AbstractCaosDBException end
# Adapt this path if you haven't compiled jlcaosdb to `caosdb-julialib/build`
@wrapmodule(joinpath(@__DIR__, "../jlcaosdb/build/lib/libjlcaosdb"))
......@@ -21,22 +13,5 @@ function __init__()
@initcxx
end
"""
get_libcaosdb_version()
Returns the version string of libcaosdb with which this package has
been built.
"""
function get_libcaosdb_version()
major = get_libcaosdb_version_major()
minor = get_libcaosdb_version_minor()
patch = get_libcaosdb_version_patch()
return "$major.$minor.$patch"
end
# Override the exception printing
Base.showerror(io::IO, e::AuthenticationError) = print(io, what(e))
Base.showerror(io::IO, e::ConnectionError) = print(io, what(e))
end # module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment