Skip to content

Commit

Permalink
chore: rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
engsr6982 committed Mar 12, 2024
1 parent b45d8c9 commit eacbfa9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
30 changes: 14 additions & 16 deletions src/change_this/RenameThis.cpp → src/Entry/Entry.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#include "RenameThis.h"
#include "Entry.h"

#include <ll/api/plugin/NativePlugin.h>
#include <memory>

namespace rename_this {
namespace entry {

RenameThis::RenameThis() = default;
entry::entry() = default;

RenameThis& RenameThis::getInstance() {
static RenameThis instance;
entry& entry::getInstance() {
static entry instance;
return instance;
}

ll::plugin::NativePlugin& RenameThis::getSelf() const { return *mSelf; }
ll::plugin::NativePlugin& entry::getSelf() const { return *mSelf; }

bool RenameThis::load(ll::plugin::NativePlugin& self) {
bool entry::load(ll::plugin::NativePlugin& self) {
mSelf = std::addressof(self);
getSelf().getLogger().info("loading...");

Expand All @@ -23,15 +23,15 @@ bool RenameThis::load(ll::plugin::NativePlugin& self) {
return true;
}

bool RenameThis::enable() {
bool entry::enable() {
getSelf().getLogger().info("enabling...");

// Code for enabling the plugin goes here.

return true;
}

bool RenameThis::disable() {
bool entry::disable() {
getSelf().getLogger().info("disabling...");

// Code for disabling the plugin goes here.
Expand All @@ -40,19 +40,17 @@ bool RenameThis::disable() {
}

extern "C" {
_declspec(dllexport) bool ll_plugin_load(ll::plugin::NativePlugin& self) {
return RenameThis::getInstance().load(self);
}
_declspec(dllexport) bool ll_plugin_load(ll::plugin::NativePlugin& self) { return entry::getInstance().load(self); }

_declspec(dllexport) bool ll_plugin_enable(ll::plugin::NativePlugin&) { return RenameThis::getInstance().enable(); }
_declspec(dllexport) bool ll_plugin_enable(ll::plugin::NativePlugin&) { return entry::getInstance().enable(); }

_declspec(dllexport) bool ll_plugin_disable(ll::plugin::NativePlugin&) { return RenameThis::getInstance().disable(); }
_declspec(dllexport) bool ll_plugin_disable(ll::plugin::NativePlugin&) { return entry::getInstance().disable(); }

/// @warning Unloading the plugin may cause a crash if the plugin has not released all of its
/// resources. If you are unsure, keep this function commented out.
// _declspec(dllexport) bool ll_plugin_unload(ll::plugin::NativePlugin&) {
// return RenameThis::getInstance().unload();
// return entry::getInstance().unload();
// }
}

} // namespace rename_this
} // namespace entry
18 changes: 9 additions & 9 deletions src/change_this/RenameThis.h → src/Entry/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

#include <ll/api/plugin/NativePlugin.h>

namespace rename_this {
namespace entry {

class RenameThis {
RenameThis();
class entry {
entry();

public:
RenameThis(RenameThis&&) = delete;
RenameThis(const RenameThis&) = delete;
RenameThis& operator=(RenameThis&&) = delete;
RenameThis& operator=(const RenameThis&) = delete;
entry(entry&&) = delete;
entry(const entry&) = delete;
entry& operator=(entry&&) = delete;
entry& operator=(const entry&) = delete;

static RenameThis& getInstance();
static entry& getInstance();

[[nodiscard]] ll::plugin::NativePlugin& getSelf() const;

Expand All @@ -30,4 +30,4 @@ class RenameThis {
ll::plugin::NativePlugin* mSelf{};
};

} // namespace rename_this
} // namespace entry
File renamed without changes.

0 comments on commit eacbfa9

Please sign in to comment.