Loading...
Searching...
No Matches
DynamicLibrary.hpp
1#pragma once
2#include <ossia/detail/dylib_loader.hpp>
3
4#include <optional>
5#include <string_view>
6#include <utility>
7#include <vector>
8
9namespace score
10{
11
21[[nodiscard]] inline std::optional<ossia::dylib_loader>
22try_load_library(const char* name) noexcept
23{
24 try
25 {
26 return ossia::dylib_loader{name};
27 }
28 catch(...)
29 {
30 return std::nullopt;
31 }
32}
33
35[[nodiscard]] inline std::optional<ossia::dylib_loader>
36try_load_library(std::vector<std::string_view> names) noexcept
37{
38 try
39 {
40 return ossia::dylib_loader{std::move(names)};
41 }
42 catch(...)
43 {
44 return std::nullopt;
45 }
46}
47
48}
Base toolkit upon which the software is built.
Definition Application.cpp:117
std::optional< ossia::dylib_loader > try_load_library(const char *name) noexcept
dlopen a library, reporting absence instead of throwing.
Definition DynamicLibrary.hpp:22