Stop including FileUtils.h in any header

This causes every piece of code which wants to use CFile or CDir to have to
include FileUtils.h. This causes quite some noise.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-04-03 11:48:50 +02:00
parent 1761fe71e4
commit 3f24f28736
23 changed files with 52 additions and 29 deletions

View File

@@ -7,6 +7,7 @@
*/
#include "Chan.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "User.h"
#include "znc.h"

2
Chan.h
View File

@@ -10,7 +10,6 @@
#define _CHAN_H
#include "zncconfig.h"
#include "FileUtils.h"
#include "Nick.h"
#include "ZNCString.h"
#include <map>
@@ -25,6 +24,7 @@ using std::set;
class CUser;
class CClient;
class CConfig;
class CFile;
// !Forward Declarations
class CChan {

View File

@@ -9,6 +9,7 @@
#include "Client.h"
#include "Chan.h"
#include "DCCBounce.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "User.h"
#include "znc.h"

View File

@@ -10,11 +10,12 @@
#include "Chan.h"
#include "DCCBounce.h"
#include "DCCSock.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "Listener.h"
#include "Server.h"
#include "User.h"
#include "znc.h"
#include "Listener.h"
void CClient::UserCommand(CString& sLine) {
if (!m_pUser) {

View File

@@ -7,6 +7,7 @@
*/
#include "Config.h"
#include "FileUtils.h"
#include <stack>
#include <sstream>

View File

@@ -10,7 +10,8 @@
#define CONFIG_H
#include "ZNCString.h"
#include "FileUtils.h"
class CFile;
class CConfig {
public:

View File

@@ -7,6 +7,7 @@
*/
#include "DCCSock.h"
#include "FileUtils.h"
#include "User.h"
#include "Utils.h"
@@ -236,3 +237,13 @@ CFile* CDCCSock::OpenFile(bool bWrite) {
return m_pFile;
}
bool CDCCSock::Seek(unsigned int uPos) {
if (m_pFile) {
if (m_pFile->Seek(uPos)) {
m_uBytesSoFar = uPos;
return true;
}
}
return false;
}

View File

@@ -10,11 +10,11 @@
#define _DCCSOCK_H
#include "zncconfig.h"
#include "FileUtils.h"
#include "Socket.h"
// Forward Declarations
class CUser;
class CFile;
// !Forward Declarations
class CDCCSock : public CZNCSock {
@@ -32,16 +32,7 @@ public:
void SendPacket();
virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort);
CFile* OpenFile(bool bWrite = true);
bool Seek(unsigned int uPos) {
if (m_pFile) {
if (m_pFile->Seek(uPos)) {
m_uBytesSoFar = uPos;
return true;
}
}
return false;
}
bool Seek(unsigned int uPos);
// Setters
void SetRemoteIP(const CString& s) { m_sRemoteIP = s; }

View File

@@ -7,11 +7,12 @@
*/
#include "Modules.h"
#include "FileUtils.h"
#include "Template.h"
#include "User.h"
#include "WebModules.h"
#include "znc.h"
#include <dlfcn.h>
#include "WebModules.h"
#include "Template.h"
#ifndef RTLD_LOCAL
# define RTLD_LOCAL 0

View File

@@ -10,6 +10,7 @@
#include "Chan.h"
#include "Config.h"
#include "DCCSock.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "Server.h"
#include "znc.h"
@@ -1514,4 +1515,6 @@ unsigned int CUser::GetBufferCount() const { return m_uBufferCount; }
bool CUser::KeepBuffer() const { return m_bKeepBuffer; }
//CString CUser::GetSkinName() const { return (!m_sSkinName.empty()) ? m_sSkinName : CZNC::Get().GetSkinName(); }
CString CUser::GetSkinName() const { return m_sSkinName; }
const CString& CUser::GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CDir::MakeDir(m_sUserPath); } return m_sUserPath; }
const CString& CUser::GetDLPath() const { if (!CFile::Exists(m_sDLPath)) { CDir::MakeDir(m_sDLPath); } return m_sDLPath; }
// !Getters

6
User.h
View File

@@ -11,7 +11,6 @@
#include "zncconfig.h"
#include "Buffer.h"
#include "FileUtils.h"
#include "Modules.h"
#include "Nick.h"
#include <set>
@@ -23,6 +22,7 @@ using std::vector;
class CChan;
class CClient;
class CConfig;
class CFile;
class CIRCSock;
class CUserTimer;
class CServer;
@@ -198,8 +198,8 @@ public:
const CString& GetChanPrefixes() const { return m_sChanPrefixes; }
bool IsChan(const CString& sChan) const;
const CString& GetUserPath() const { if (!CFile::Exists(m_sUserPath)) { CDir::MakeDir(m_sUserPath); } return m_sUserPath; }
const CString& GetDLPath() const { if (!CFile::Exists(m_sDLPath)) { CDir::MakeDir(m_sDLPath); } return m_sDLPath; }
const CString& GetUserPath() const;
const CString& GetDLPath() const;
bool UseClientIP() const;
bool DenyLoadMod() const;

View File

@@ -7,6 +7,7 @@
*/
#include "WebModules.h"
#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include <sstream>

View File

@@ -6,9 +6,10 @@
* by the Free Software Foundation.
*/
#include "User.h"
#include "Client.h"
#include "FileUtils.h"
#include "Server.h"
#include "User.h"
#include <syslog.h>

View File

@@ -12,6 +12,7 @@
#define REQUIRESSL
#include "User.h"
#include "FileUtils.h"
#include <sys/stat.h>
#define CRYPT_VERIFICATION_TOKEN "::__:AWAY:__::"

View File

@@ -9,6 +9,7 @@
* Author: imaginos <imaginos@imaginos.net>
*/
#include "FileUtils.h"
#include "MD5.h"
#include "User.h"
#include "znc.h"

View File

@@ -7,6 +7,7 @@
* by the Free Software Foundation.
*/
#include "FileUtils.h"
#include "User.h"
#include "Chan.h"
#include "Server.h"

View File

@@ -6,6 +6,7 @@
* by the Free Software Foundation.
*/
#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include "ExecSock.h"

View File

@@ -6,9 +6,10 @@
* by the Free Software Foundation.
*/
#include "znc.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "User.h"
#include "znc.h"
class CIdentFileModule : public CGlobalModule {
CString m_sOrigISpoof;

View File

@@ -6,12 +6,13 @@
* by the Free Software Foundation.
*/
#include "Modules.h"
#include "User.h"
#include "Chan.h"
#include "Nick.h"
#include "znc.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "Modules.h"
#include "Nick.h"
#include "User.h"
#include "znc.h"
#include "modperl/module.h"
#include "modperl/swigperlrun.h"

View File

@@ -8,12 +8,13 @@
#include <Python.h>
#include "Modules.h"
#include "User.h"
#include "Chan.h"
#include "Nick.h"
#include "znc.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "Modules.h"
#include "Nick.h"
#include "User.h"
#include "znc.h"
#include "modpython/swigpyrun.h"
#include "modpython/module.h"

View File

@@ -16,6 +16,7 @@
#include "Chan.h"
#include "User.h"
#include "FileUtils.h"
#include <sys/stat.h>
#define CRYPT_VERIFICATION_TOKEN "::__:SAVEBUFF:__::"

View File

@@ -11,6 +11,7 @@
#define REQUIRESSL
#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include <sstream>

View File

@@ -8,6 +8,7 @@
#include "znc.h"
#include "Chan.h"
#include "FileUtils.h"
#include "IRCSock.h"
#include "Server.h"
#include "User.h"