mirror of
https://github.com/znc/znc.git
synced 2026-08-09 10:23:14 +02:00
Don't include FileUtils.h in znc.h or Modules.h
Both these headers only really need CFile* which can be handled with a forward declaration. To make this possible, some methods are moved from the header file into the corresponding implementation file, because they used CFile or CDir static members. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
+2
-1
@@ -6,8 +6,9 @@
|
||||
* by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include "Modules.h"
|
||||
#include "HTTPSock.h"
|
||||
#include "FileUtils.h"
|
||||
#include "Modules.h"
|
||||
#include "znc.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -145,6 +145,13 @@ CModule::~CModule() {
|
||||
void CModule::SetUser(CUser* pUser) { m_pUser = pUser; }
|
||||
void CModule::SetClient(CClient* pClient) { m_pClient = pClient; }
|
||||
|
||||
const CString& CModule::GetSavePath() const {
|
||||
if (!CFile::Exists(m_sSavePath)) {
|
||||
CDir::MakeDir(m_sSavePath);
|
||||
}
|
||||
return m_sSavePath;
|
||||
}
|
||||
|
||||
bool CModule::LoadRegistry() {
|
||||
//CString sPrefix = (m_pUser) ? m_pUser->GetUserName() : ".global";
|
||||
return (m_mssRegistry.ReadFromDisk(GetSavePath() + "/.registry") == MCString::MCS_SUCCESS);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "zncconfig.h"
|
||||
#include "WebModules.h"
|
||||
#include "FileUtils.h"
|
||||
#include "Utils.h"
|
||||
#include <set>
|
||||
#include <queue>
|
||||
@@ -825,7 +824,7 @@ public:
|
||||
void DelNV(MCString::iterator it) { m_mssRegistry.erase(it); }
|
||||
bool ClearNV(bool bWriteToDisk = true);
|
||||
|
||||
const CString& GetSavePath() const { if (!CFile::Exists(m_sSavePath)) { CDir::MakeDir(m_sSavePath); } return m_sSavePath; }
|
||||
const CString& GetSavePath() const;
|
||||
|
||||
// Setters
|
||||
void SetGlobal(bool b) { m_bGlobal = b; }
|
||||
|
||||
@@ -384,6 +384,27 @@ CString CZNC::GetModPath() const {
|
||||
return sModPath;
|
||||
}
|
||||
|
||||
const CString& CZNC::GetCurPath() const {
|
||||
if (!CFile::Exists(m_sCurPath)) {
|
||||
CDir::MakeDir(m_sCurPath);
|
||||
}
|
||||
return m_sCurPath;
|
||||
}
|
||||
|
||||
const CString& CZNC::GetHomePath() const {
|
||||
return CFile::GetHomePath();
|
||||
}
|
||||
|
||||
const CString& CZNC::GetZNCPath() const {
|
||||
if (!CFile::Exists(m_sZNCPath)) {
|
||||
CDir::MakeDir(m_sZNCPath);
|
||||
}
|
||||
return m_sZNCPath;
|
||||
}
|
||||
|
||||
CString CZNC::GetPemLocation() const {
|
||||
return CDir::ChangeDir("", m_sSSLCertFile);
|
||||
}
|
||||
|
||||
CString CZNC::ExpandConfigPath(const CString& sConfigFile, bool bAllowMkDir) {
|
||||
CString sRetPath;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "zncconfig.h"
|
||||
#include "Client.h"
|
||||
#include "FileUtils.h"
|
||||
#include "Modules.h"
|
||||
#include "Socket.h"
|
||||
#include <map>
|
||||
@@ -22,6 +21,7 @@ class CListener;
|
||||
class CUser;
|
||||
class CConnectUserTimer;
|
||||
class CConfig;
|
||||
class CFile;
|
||||
|
||||
class CZNC {
|
||||
public:
|
||||
@@ -95,13 +95,13 @@ public:
|
||||
size_t FilterUncommonModules(set<CModInfo>& ssModules);
|
||||
CString GetSkinName() const { return m_sSkinName; }
|
||||
const CString& GetStatusPrefix() const { return m_sStatusPrefix; }
|
||||
const CString& GetCurPath() const { if (!CFile::Exists(m_sCurPath)) { CDir::MakeDir(m_sCurPath); } return m_sCurPath; }
|
||||
const CString& GetHomePath() const { return CFile::GetHomePath(); }
|
||||
const CString& GetZNCPath() const { if (!CFile::Exists(m_sZNCPath)) { CDir::MakeDir(m_sZNCPath); } return m_sZNCPath; }
|
||||
const CString& GetCurPath() const;
|
||||
const CString& GetHomePath() const;
|
||||
const CString& GetZNCPath() const;
|
||||
CString GetConfPath(bool bAllowMkDir = true) const;
|
||||
CString GetUserPath() const;
|
||||
CString GetModPath() const;
|
||||
CString GetPemLocation() const { return CDir::ChangeDir("", m_sSSLCertFile); }
|
||||
CString GetPemLocation() const;
|
||||
const CString& GetConfigFile() const { return m_sConfigFile; }
|
||||
bool WritePemFile();
|
||||
const VCString& GetBindHosts() const { return m_vsBindHosts; }
|
||||
|
||||
Reference in New Issue
Block a user