2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2020-08-09 20:47:33 +00:00
|
|
|
|
|
|
|
#pragma once
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-disable.hpp"
|
2020-08-09 20:47:33 +00:00
|
|
|
#include <filesystem>
|
|
|
|
#include <memory>
|
2020-11-05 05:25:49 +00:00
|
|
|
#include <string_view>
|
2023-03-09 14:14:12 +00:00
|
|
|
|
|
|
|
#include <obs.h>
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-enable.hpp"
|
2020-08-09 20:47:33 +00:00
|
|
|
|
2021-06-08 02:18:02 +00:00
|
|
|
namespace streamfx::util {
|
2020-08-09 20:47:33 +00:00
|
|
|
class library {
|
|
|
|
void* _library;
|
2023-03-09 14:14:12 +00:00
|
|
|
bool _owner;
|
2020-08-09 20:47:33 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
library(std::filesystem::path file);
|
2023-03-09 14:14:12 +00:00
|
|
|
library(obs_module_t* library);
|
2020-08-09 20:47:33 +00:00
|
|
|
~library();
|
|
|
|
|
2020-11-05 05:25:49 +00:00
|
|
|
void* load_symbol(std::string_view name);
|
2020-08-09 20:47:33 +00:00
|
|
|
|
2023-03-09 14:14:12 +00:00
|
|
|
public:
|
2021-06-08 02:18:02 +00:00
|
|
|
static std::shared_ptr<::streamfx::util::library> load(std::filesystem::path file);
|
2020-08-09 20:47:33 +00:00
|
|
|
|
2021-06-08 02:18:02 +00:00
|
|
|
static std::shared_ptr<::streamfx::util::library> load(std::string_view name);
|
2023-03-09 14:14:12 +00:00
|
|
|
|
|
|
|
static std::shared_ptr<::streamfx::util::library> load(obs_module_t* instance);
|
2020-08-09 20:47:33 +00:00
|
|
|
};
|
2021-06-08 02:18:02 +00:00
|
|
|
} // namespace streamfx::util
|