Skip to content

Commit

Permalink
update plugin code
Browse files Browse the repository at this point in the history
  • Loading branch information
htartisan committed Jan 10, 2025
1 parent e0520f6 commit 2bf784f
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 20 deletions.
18 changes: 9 additions & 9 deletions Src/Logging/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,6 @@ class CLogger

void setLogLevel(eLogLevel logLevel)
{
if (m_mainLogger == nullptr)
{
spdlog::set_level(getSpdlogLevel(m_nLogLevel));
}
else
{
m_mainLogger->set_level(getSpdlogLevel(m_nLogLevel));
}

if (m_consoleSink != nullptr)
{
m_consoleSink->set_level(getSpdlogLevel(m_nLogLevel));
Expand All @@ -155,6 +146,15 @@ class CLogger
{
m_fileSink->set_level(getSpdlogLevel(m_nLogLevel));
}

if (m_mainLogger == nullptr)
{
spdlog::set_level(getSpdlogLevel(m_nLogLevel));
}
else
{
m_mainLogger->set_level(getSpdlogLevel(m_nLogLevel));
}
}

std::string getLogFilePath(const std::string sDir)
Expand Down
77 changes: 77 additions & 0 deletions Src/PlugIn/CPluginFileInfoMgr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
///****************************************************************************
/// FILE: CPluginFileInfoMgr.h
///
/// DEESC: Plugin (lib) interface manager class def
///
/// AUTHOR: Russ Barker
///


#ifndef PLUGIN_FILE_INFO_MANAGER_H
#define PLUGIN_FILE_INFO_MANAGER_H


#include <string>
#include <vector>
#include <memory>
#include <vector>

#include "../Error/CError.h"

#include "PluginDefs.h"


// All plugins MUST provide a root class
// derived from this

//class PLUGIN_LIB_API CPluginFileInfoMgrBase
class CPluginFileInfoMgrBase
{

protected:

std::string m_sPluginModuleName;

std::string m_sPluginDescription;

int m_nPluginType;

public:

CPluginFileInfoMgrBase()
{
clear();
}

~CPluginFileInfoMgrBase()
{
clear();
}

void clear()
{
m_sPluginModuleName.clear();
m_sPluginDescription.clear();
m_nPluginType = 0;
}

std::string GetPluginModuleName()
{
return m_sPluginModuleName;
}

std::string GetPluginDescription()
{
return m_sPluginDescription;
}

int GetPluginType()
{
return m_nPluginType;
}

};



#endif // PLUGIN_FILE_INFO_MANAGER_H
10 changes: 5 additions & 5 deletions Src/PlugIn/CPluginFileMgr.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///****************************************************************************
/// FILE: CPluginFileMgr.h
///
/// DEESC: Plugin (lib) file manager class def
/// DEESC: Plugin (lib) file inst manager class def
///
/// AUTHOR: Russ Barker
///
Expand Down Expand Up @@ -39,7 +39,7 @@ class CPluginFileMgr

public:

CPluginFileMgr(const std::string &sDir = "", const std::string &sExt = "") :
CPluginFileMgr(const std::string &sDir = "", const std::string &sExt = "") :
m_sDirPath(sDir),
m_sPluginFileExt(sExt)
{
Expand Down Expand Up @@ -71,7 +71,7 @@ class CPluginFileMgr

int findPluginFiles(const std::string &sExt = "")
{
if (sExt.empty() != false)
if (sExt != "")
m_sPluginFileExt = sExt;

if (m_sDirPath.empty() || m_sPluginFileExt.empty())
Expand All @@ -87,7 +87,7 @@ class CPluginFileMgr

std::string sCurrFileExt = entry.path().extension().string();

if (sCurrFileExt == m_sPluginFileExt)
if (sCurrFileExt == ("." + m_sPluginFileExt))
{
m_pluginFileList.push_back(sCurrFilePath);
}
Expand All @@ -113,4 +113,4 @@ class CPluginFileMgr
};


#endif / PLUGIN_FILE_MGR_H
#endif // PLUGIN_FILE_MGR_H
Loading

0 comments on commit 2bf784f

Please sign in to comment.