Skip to content
Browse files

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>
  • Loading branch information...
1 parent 1761fe7 commit 3f24f28736304b747ea2fbb5dcf48796011b546c @psychon psychon committed Apr 3, 2011
Showing with 50 additions and 27 deletions.
  1. +1 −0 Chan.cpp
  2. +1 −1 Chan.h
  3. +1 −0 Client.cpp
  4. +2 −1 ClientCommand.cpp
  5. +1 −0 Config.cpp
  6. +2 −1 Config.h
  7. +11 −0 DCCSock.cpp
  8. +2 −11 DCCSock.h
  9. +3 −2 Modules.cpp
  10. +3 −0 User.cpp
  11. +3 −3 User.h
  12. +1 −0 WebModules.cpp
  13. +2 −1 modules/adminlog.cpp
  14. +1 −0 modules/away.cpp
  15. +1 −0 modules/extra/email.cpp
  16. +1 −0 modules/extra/log.cpp
  17. +1 −0 modules/extra/shell.cpp
  18. +2 −1 modules/identfile.cpp
  19. +4 −3 modules/modperl.cpp
  20. +4 −3 modules/modpython.cpp
  21. +1 −0 modules/savebuff.cpp
  22. +1 −0 modules/schat.cpp
  23. +1 −0 znc.cpp
View
1 Chan.cpp
@@ -7,6 +7,7 @@
*/
#include "Chan.h"
+#include "FileUtils.h"
#include "IRCSock.h"
#include "User.h"
#include "znc.h"
View
2 Chan.h
@@ -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
1 Client.cpp
@@ -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
3 ClientCommand.cpp
@@ -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
1 Config.cpp
@@ -7,6 +7,7 @@
*/
#include "Config.h"
+#include "FileUtils.h"
#include <stack>
#include <sstream>
View
3 Config.h
@@ -10,7 +10,8 @@
#define CONFIG_H
#include "ZNCString.h"
-#include "FileUtils.h"
+
+class CFile;
class CConfig {
public:
View
11 DCCSock.cpp
@@ -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
13 DCCSock.h
@@ -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 @@ class CDCCSock : public CZNCSock {
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
5 Modules.cpp
@@ -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
3 User.cpp
@@ -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
View
6 User.h
@@ -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 @@ class CUser {
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
1 WebModules.cpp
@@ -7,6 +7,7 @@
*/
#include "WebModules.h"
+#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include <sstream>
View
3 modules/adminlog.cpp
@@ -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
1 modules/away.cpp
@@ -12,6 +12,7 @@
#define REQUIRESSL
#include "User.h"
+#include "FileUtils.h"
#include <sys/stat.h>
#define CRYPT_VERIFICATION_TOKEN "::__:AWAY:__::"
View
1 modules/extra/email.cpp
@@ -9,6 +9,7 @@
* Author: imaginos <imaginos@imaginos.net>
*/
+#include "FileUtils.h"
#include "MD5.h"
#include "User.h"
#include "znc.h"
View
1 modules/extra/log.cpp
@@ -7,6 +7,7 @@
* by the Free Software Foundation.
*/
+#include "FileUtils.h"
#include "User.h"
#include "Chan.h"
#include "Server.h"
View
1 modules/extra/shell.cpp
@@ -6,6 +6,7 @@
* by the Free Software Foundation.
*/
+#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include "ExecSock.h"
View
3 modules/identfile.cpp
@@ -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
7 modules/modperl.cpp
@@ -6,12 +6,13 @@
* by the Free Software Foundation.
*/
-#include "Modules.h"
-#include "User.h"
#include "Chan.h"
+#include "FileUtils.h"
+#include "IRCSock.h"
+#include "Modules.h"
#include "Nick.h"
+#include "User.h"
#include "znc.h"
-#include "IRCSock.h"
#include "modperl/module.h"
#include "modperl/swigperlrun.h"
View
7 modules/modpython.cpp
@@ -8,12 +8,13 @@
#include <Python.h>
-#include "Modules.h"
-#include "User.h"
#include "Chan.h"
+#include "FileUtils.h"
+#include "IRCSock.h"
+#include "Modules.h"
#include "Nick.h"
+#include "User.h"
#include "znc.h"
-#include "IRCSock.h"
#include "modpython/swigpyrun.h"
#include "modpython/module.h"
View
1 modules/savebuff.cpp
@@ -16,6 +16,7 @@
#include "Chan.h"
#include "User.h"
+#include "FileUtils.h"
#include <sys/stat.h>
#define CRYPT_VERIFICATION_TOKEN "::__:SAVEBUFF:__::"
View
1 modules/schat.cpp
@@ -11,6 +11,7 @@
#define REQUIRESSL
+#include "FileUtils.h"
#include "User.h"
#include "znc.h"
#include <sstream>
View
1 znc.cpp
@@ -8,6 +8,7 @@
#include "znc.h"
#include "Chan.h"
+#include "FileUtils.h"
#include "IRCSock.h"
#include "Server.h"
#include "User.h"

0 comments on commit 3f24f28

Please sign in to comment.
Something went wrong with that request. Please try again.