repaired some path handling, improved error handling
This commit is contained in:
@@ -2,25 +2,20 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "error.hpp"
|
||||
#include "dpm_interface.hpp"
|
||||
#include <filesystem>
|
||||
#include <dlfcn.h>
|
||||
#include <iostream>
|
||||
#include <module_interface.hpp>
|
||||
|
||||
// Forward declaration to avoid circular dependency
|
||||
struct CommandArgs;
|
||||
#include "module_interface.hpp"
|
||||
|
||||
class ModuleLoader {
|
||||
public:
|
||||
explicit ModuleLoader(std::string module_path = "/usr/lib/dpm/modules/");
|
||||
DPMError list_available_modules(std::vector<std::string>& modules) const;
|
||||
DPMError get_module_path(std::string& path) const;
|
||||
DPMError get_absolute_module_path(std::string& abs_path) const;
|
||||
|
||||
// Load and execute methods
|
||||
DPMError load_module(const std::string& module_name, void*& module_handle) const;
|
||||
DPMError execute_module(void* module_handle, const std::string& command) const;
|
||||
DPMError execute_module(const std::string& module_name, const std::string& command) const;
|
||||
|
||||
// Get module version
|
||||
DPMError get_module_version(void* module_handle, std::string& version) const;
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
#include "error.hpp"
|
||||
#include <dlfcn.h>
|
||||
#include <iomanip>
|
||||
#include "ModuleLoader.hpp" // This should include ModuleLoader since it's used directly
|
||||
#include <filesystem>
|
||||
#include "ModuleLoader.hpp"
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user