Permalink
Browse files

using in headers is evil :(

  • Loading branch information...
1 parent f1932b9 commit 62c9ac1a0b7ec316e4633b0314a05fece29238c7 @DarthGandalf DarthGandalf committed Jul 26, 2012
Showing with 234 additions and 154 deletions.
  1. +1 −3 include/znc/Buffer.h
  2. +5 −11 include/znc/Chan.h
  3. +1 −1 include/znc/Client.h
  4. +3 −3 include/znc/Config.h
  5. +1 −5 include/znc/FileUtils.h
  6. +9 −9 include/znc/HTTPSock.h
  7. +6 −6 include/znc/IRCNetwork.h
  8. +6 −7 include/znc/IRCSock.h
  9. +16 −18 include/znc/Modules.h
  10. +1 −5 include/znc/Nick.h
  11. +12 −14 include/znc/Template.h
  12. +7 −10 include/znc/User.h
  13. +9 −13 include/znc/Utils.h
  14. +1 −1 include/znc/WebModules.h
  15. +1 −4 include/znc/ZNCDebug.h
  16. +12 −20 include/znc/ZNCString.h
  17. +8 −11 include/znc/znc.h
  18. +3 −0 modules/admin.cpp
  19. +2 −0 modules/autoattach.cpp
  20. +2 −0 modules/autocycle.cpp
  21. +4 −0 modules/autoop.cpp
  22. +3 −0 modules/autovoice.cpp
  23. +3 −0 modules/awaystore.cpp
  24. +2 −0 modules/blockuser.cpp
  25. +2 −0 modules/bouncedcc.cpp
  26. +2 −0 modules/buffextras.cpp
  27. +5 −0 modules/certauth.cpp
  28. +2 −0 modules/chansaver.cpp
  29. +2 −0 modules/clearbufferonmsg.cpp
  30. +2 −0 modules/clientnotify.cpp
  31. +2 −0 modules/dcc.cpp
  32. +2 −1 modules/disconkick.cpp
  33. +2 −0 modules/flooddetach.cpp
  34. +2 −0 modules/keepnick.cpp
  35. +5 −3 modules/log.cpp
  36. +3 −0 modules/modperl.cpp
  37. +4 −4 modules/modperl/modperl.i
  38. +2 −2 modules/modperl/module.h
  39. +3 −0 modules/modpython.cpp
  40. +1 −1 modules/modpython/modpython.i
  41. +2 −2 modules/modpython/module.h
  42. +4 −0 modules/partyline.cpp
  43. +2 −0 modules/q.cpp
  44. +2 −0 modules/sample.cpp
  45. +2 −0 modules/savebuff.cpp
  46. +3 −0 modules/schat.cpp
  47. +3 −0 modules/send_raw.cpp
  48. +2 −0 modules/shell.cpp
  49. +2 −0 modules/stickychan.cpp
  50. +1 −0 modules/watch.cpp
  51. +3 −0 modules/webadmin.cpp
  52. +4 −0 src/Chan.cpp
  53. +2 −0 src/Client.cpp
  54. +4 −0 src/ClientCommand.cpp
  55. +3 −0 src/HTTPSock.cpp
  56. +3 −0 src/IRCNetwork.cpp
  57. +4 −0 src/IRCSock.cpp
  58. +4 −0 src/Modules.cpp
  59. +3 −0 src/Nick.cpp
  60. +4 −0 src/Template.cpp
  61. +3 −0 src/User.cpp
  62. +1 −0 src/Utils.cpp
  63. +3 −0 src/WebModules.cpp
  64. +4 −0 src/main.cpp
  65. +7 −0 src/znc.cpp
View
@@ -13,8 +13,6 @@
#include <znc/ZNCString.h>
#include <deque>
-using std::deque;
-
// Forward Declarations
class CClient;
// !Forward Declarations
@@ -45,7 +43,7 @@ class CBufLine {
time_t m_tm;
};
-class CBuffer : private deque<CBufLine> {
+class CBuffer : private std::deque<CBufLine> {
public:
CBuffer(unsigned int uLineCount = 100);
~CBuffer();
View
@@ -14,12 +14,6 @@
#include <znc/ZNCString.h>
#include <znc/Buffer.h>
#include <map>
-#include <set>
-#include <vector>
-
-using std::vector;
-using std::map;
-using std::set;
// Forward Declarations
class CUser;
@@ -126,16 +120,16 @@ class CChan {
bool HasMode(unsigned char uMode) const;
CString GetOptions() const;
CString GetModeArg(unsigned char uMode) const;
- map<char, unsigned int> GetPermCounts() const;
+ std::map<char, unsigned int> GetPermCounts() const;
bool IsOn() const { return m_bIsOn; }
const CString& GetName() const { return m_sName; }
- const map<unsigned char, CString>& GetModes() const { return m_musModes; }
+ const std::map<unsigned char, CString>& GetModes() const { return m_musModes; }
const CString& GetKey() const { return m_sKey; }
const CString& GetTopic() const { return m_sTopic; }
const CString& GetTopicOwner() const { return m_sTopicOwner; }
unsigned int GetTopicDate() const { return m_ulTopicDate; }
const CString& GetDefaultModes() const { return m_sDefaultModes; }
- const map<CString,CNick>& GetNicks() const { return m_msNicks; }
+ const std::map<CString,CNick>& GetNicks() const { return m_msNicks; }
unsigned int GetNickCount() const { return m_msNicks.size(); }
bool AutoClearChanBuffer() const { return m_bAutoClearChanBuffer; }
bool IsDetached() const { return m_bDetached; }
@@ -161,11 +155,11 @@ class CChan {
CNick m_Nick;
unsigned int m_uJoinTries;
CString m_sDefaultModes;
- map<CString,CNick> m_msNicks; // Todo: make this caseless (irc style)
+ std::map<CString,CNick> m_msNicks; // Todo: make this caseless (irc style)
CBuffer m_Buffer;
bool m_bModeKnown;
- map<unsigned char, CString> m_musModes;
+ std::map<unsigned char, CString> m_musModes;
};
#endif // !_CHAN_H
View
@@ -138,7 +138,7 @@ class CClient : public CZNCSock {
CUser* GetUser() const { return m_pUser; }
void SetNetwork(CIRCNetwork* pNetwork, bool bDisconnect=true, bool bReconnect=true);
CIRCNetwork* GetNetwork() const { return m_pNetwork; }
- vector<CClient*>& GetClients();
+ std::vector<CClient*>& GetClients();
const CIRCSock* GetIRCSock() const;
CIRCSock* GetIRCSock();
CString GetFullName();
View
@@ -27,9 +27,9 @@ struct CConfigEntry {
class CConfig {
public:
- typedef map<CString, VCString> EntryMap;
- typedef map<CString, CConfigEntry> SubConfig;
- typedef map<CString, SubConfig> SubConfigMap;
+ typedef std::map<CString, VCString> EntryMap;
+ typedef std::map<CString, CConfigEntry> SubConfig;
+ typedef std::map<CString, SubConfig> SubConfigMap;
typedef EntryMap::const_iterator EntryMapIterator;
typedef SubConfigMap::const_iterator SubConfigMapIterator;
View
@@ -12,16 +12,12 @@
#include <znc/zncconfig.h>
#include <znc/ZNCString.h>
#include <dirent.h>
-#include <map>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <unistd.h>
#include <vector>
-using std::vector;
-using std::map;
-
class CFile {
public:
CFile();
@@ -143,7 +139,7 @@ class CFile {
CString m_sShortName; //!< Filename alone, without path
};
-class CDir : public vector<CFile*> {
+class CDir : public std::vector<CFile*> {
public:
CDir(const CString& sDir) {
View
@@ -43,7 +43,7 @@ class CHTTPSock : public CSocket {
bool PrintNotFound();
bool Redirect(const CString& sURL);
bool PrintErrorPage(unsigned int uStatusId, const CString& sStatusMsg, const CString& sMessage);
- static void ParseParams(const CString& sParams, map<CString, VCString>& msvsParams);
+ static void ParseParams(const CString& sParams, std::map<CString, VCString>& msvsParams);
void ParseURI();
void GetPage();
static CString GetDate(time_t tm = 0);
@@ -73,15 +73,15 @@ class CHTTPSock : public CSocket {
CString GetParam(const CString& sName, bool bPost = true, const CString& sFilter = "\r\n") const;
CString GetRawParam(const CString& sName, bool bPost = true) const;
bool HasParam(const CString& sName, bool bPost = true) const;
- const map<CString, VCString>& GetParams(bool bPost = true) const;
+ const std::map<CString, VCString>& GetParams(bool bPost = true) const;
unsigned int GetParamValues(const CString& sName, VCString& vsRet, bool bPost = true, const CString& sFilter = "\r\n") const;
- unsigned int GetParamValues(const CString& sName, set<CString>& ssRet, bool bPost = true, const CString& sFilter = "\r\n") const;
+ unsigned int GetParamValues(const CString& sName, std::set<CString>& ssRet, bool bPost = true, const CString& sFilter = "\r\n") const;
// !Parameter access
private:
- static CString GetRawParam(const CString& sName, const map<CString, VCString>& msvsParams);
- static CString GetParam(const CString& sName, const map<CString, VCString>& msvsParams, const CString& sFilter);
- static unsigned int GetParamValues(const CString& sName, VCString& vsRet, const map<CString, VCString>& msvsParams, const CString& sFilter);
- static unsigned int GetParamValues(const CString& sName, set<CString>& ssRet, const map<CString, VCString>& msvsParams, const CString& sFilter);
+ static CString GetRawParam(const CString& sName, const std::map<CString, VCString>& msvsParams);
+ static CString GetParam(const CString& sName, const std::map<CString, VCString>& msvsParams, const CString& sFilter);
+ static unsigned int GetParamValues(const CString& sName, VCString& vsRet, const std::map<CString, VCString>& msvsParams, const CString& sFilter);
+ static unsigned int GetParamValues(const CString& sName, std::set<CString>& ssRet, const std::map<CString, VCString>& msvsParams, const CString& sFilter);
protected:
void PrintPage(const CString& sPage);
@@ -99,8 +99,8 @@ class CHTTPSock : public CSocket {
CString m_sPass;
CString m_sContentType;
CString m_sDocRoot;
- map<CString, VCString> m_msvsPOSTParams;
- map<CString, VCString> m_msvsGETParams;
+ std::map<CString, VCString> m_msvsPOSTParams;
+ std::map<CString, VCString> m_msvsGETParams;
MCString m_msHeaders;
bool m_bHTTP10Client;
CString m_sIfNoneMatch;
View
@@ -52,7 +52,7 @@ class CIRCNetwork {
CUser* GetUser();
const CString& GetName() const;
bool IsNetworkAttached() const { return !m_vClients.empty(); };
- vector<CClient*>& GetClients() { return m_vClients; }
+ std::vector<CClient*>& GetClients() { return m_vClients; }
void SetUser(CUser *pUser);
bool SetName(const CString& sName);
@@ -66,7 +66,7 @@ class CIRCNetwork {
bool PutStatus(const CString& sLine, CClient* pClient = NULL, CClient* pSkipClient = NULL);
bool PutModule(const CString& sModule, const CString& sLine, CClient* pClient = NULL, CClient* pSkipClient = NULL);
- const vector<CChan*>& GetChans() const;
+ const std::vector<CChan*>& GetChans() const;
CChan* FindChan(const CString& sName) const;
bool AddChan(CChan* pChan);
bool AddChan(const CString& sName, bool bInConfig);
@@ -77,7 +77,7 @@ class CIRCNetwork {
void SetChanPrefixes(const CString& s) { m_sChanPrefixes = s; };
bool IsChan(const CString& sChan) const;
- const vector<CServer*>& GetServers() const;
+ const std::vector<CServer*>& GetServers() const;
bool HasServers() const { return !m_vServers.empty(); }
CServer* FindServer(const CString& sName) const;
bool DelServer(const CString& sName, unsigned short uPort, const CString& sPass);
@@ -161,17 +161,17 @@ class CIRCNetwork {
CModules* m_pModules;
- vector<CClient*> m_vClients;
+ std::vector<CClient*> m_vClients;
CIRCSock* m_pIRCSock;
- vector<CChan*> m_vChans;
+ std::vector<CChan*> m_vChans;
CString m_sChanPrefixes;
bool m_bIRCConnectEnabled;
CString m_sIRCServer;
- vector<CServer*> m_vServers;
+ std::vector<CServer*> m_vServers;
unsigned int m_uServerIdx; ///< Index in m_vServers of our current server + 1
CNick m_IRCNick;
View
@@ -14,7 +14,6 @@
#include <znc/Nick.h>
#include <deque>
-using std::deque;
// Forward Declarations
class CChan;
@@ -79,7 +78,7 @@ class CIRCSock : public CZNCSock {
unsigned int GetMaxNickLen() const { return m_uMaxNickLen; }
EChanModeArgs GetModeType(unsigned char uMode) const;
unsigned char GetPermFromMode(unsigned char uMode) const;
- const map<unsigned char, EChanModeArgs>& GetChanModes() const { return m_mueChanModes; }
+ const std::map<unsigned char, EChanModeArgs>& GetChanModes() const { return m_mueChanModes; }
bool IsPermChar(const char c) const { return (c != '\0' && GetPerms().find(c) != CString::npos); }
bool IsPermMode(const char c) const { return (c != '\0' && GetPermModes().find(c) != CString::npos); }
const CString& GetPerms() const { return m_sPerms; }
@@ -90,7 +89,7 @@ class CIRCSock : public CZNCSock {
CIRCNetwork* GetNetwork() const { return m_pNetwork; }
bool HasNamesx() const { return m_bNamesx; }
bool HasUHNames() const { return m_bUHNames; }
- const set<unsigned char>& GetUserModes() const { return m_scUserModes; }
+ const std::set<unsigned char>& GetUserModes() const { return m_scUserModes; }
// This is true if we are past raw 001
bool IsAuthed() const { return m_bAuthed; }
bool IsCapAccepted(const CString& sCap) { return 1 == m_ssAcceptedCaps.count(sCap); }
@@ -116,12 +115,12 @@ class CIRCSock : public CZNCSock {
bool m_bUHNames;
CString m_sPerms;
CString m_sPermModes;
- set<unsigned char> m_scUserModes;
- map<unsigned char, EChanModeArgs> m_mueChanModes;
+ std::set<unsigned char> m_scUserModes;
+ std::map<unsigned char, EChanModeArgs> m_mueChanModes;
CIRCNetwork* m_pNetwork;
CNick m_Nick;
CString m_sPass;
- map<CString, CChan*> m_msChans;
+ std::map<CString, CChan*> m_msChans;
unsigned int m_uMaxNickLen;
unsigned int m_uCapPaused;
SCString m_ssAcceptedCaps;
@@ -131,7 +130,7 @@ class CIRCSock : public CZNCSock {
static const time_t m_uCTCPFloodTime;
static const unsigned int m_uCTCPFloodCount;
MCString m_mISupport;
- deque<CString> m_vsSendQueue;
+ std::deque<CString> m_vsSendQueue;
short int m_iSendsAllowed;
unsigned short int m_uFloodBurst;
double m_fFloodRate;
View
@@ -15,8 +15,6 @@
#include <set>
#include <queue>
-using std::set;
-
// Forward Declarations
class CAuthBase;
class CChan;
@@ -237,7 +235,7 @@ class CModInfo {
// !Setters
private:
protected:
- set<EModuleType> m_seType;
+ std::set<EModuleType> m_seType;
EModuleType m_eDefaultType;
CString m_sName;
CString m_sPath;
@@ -539,14 +537,14 @@ class CModule {
* @param sMessage The quit message.
* @param vChans List of channels which you and nick share.
*/
- virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans);
+ virtual void OnQuit(const CNick& Nick, const CString& sMessage, const std::vector<CChan*>& vChans);
/** Called when a nickname change occurs. If we are changing our nick,
* sNewNick will equal m_pIRCSock->GetNick().
* @param Nick The nick which changed its nickname
* @param sNewNick The new nickname.
* @param vChans Channels which we and nick share.
*/
- virtual void OnNick(const CNick& Nick, const CString& sNewNick, const vector<CChan*>& vChans);
+ virtual void OnNick(const CNick& Nick, const CString& sNewNick, const std::vector<CChan*>& vChans);
/** Called when a nick is kicked from a channel.
* @param OpNick The nick which generated the kick.
* @param sKickedNick The nick which was kicked.
@@ -824,8 +822,8 @@ class CModule {
bool RemTimer(const CString& sLabel);
bool UnlinkTimer(CTimer* pTimer);
CTimer* FindTimer(const CString& sLabel);
- set<CTimer*>::const_iterator BeginTimers() const { return m_sTimers.begin(); }
- set<CTimer*>::const_iterator EndTimers() const { return m_sTimers.end(); }
+ std::set<CTimer*>::const_iterator BeginTimers() const { return m_sTimers.begin(); }
+ std::set<CTimer*>::const_iterator EndTimers() const { return m_sTimers.end(); }
virtual void ListTimers();
// !Timer stuff
@@ -835,8 +833,8 @@ class CModule {
bool RemSocket(const CString& sSockName);
bool UnlinkSocket(CSocket* pSocket);
CSocket* FindSocket(const CString& sSockName);
- set<CSocket*>::const_iterator BeginSockets() const { return m_sSockets.begin(); }
- set<CSocket*>::const_iterator EndSockets() const { return m_sSockets.end(); }
+ std::set<CSocket*>::const_iterator BeginSockets() const { return m_sSockets.begin(); }
+ std::set<CSocket*>::const_iterator EndSockets() const { return m_sSockets.end(); }
virtual void ListSockets();
// !Socket stuff
@@ -997,14 +995,14 @@ class CModule {
* @param ssMods put new modules here.
* @param bGlobal true if global modules are needed.
*/
- virtual void OnGetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType);
+ virtual void OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType);
// !Global Modules
protected:
CModInfo::EModuleType m_eType;
CString m_sDescription;
- set<CTimer*> m_sTimers;
- set<CSocket*> m_sSockets;
+ std::set<CTimer*> m_sTimers;
+ std::set<CSocket*> m_sSockets;
ModHandle m_pDLL;
CSockManager* m_pManager;
CUser* m_pUser;
@@ -1018,10 +1016,10 @@ class CModule {
private:
MCString m_mssRegistry; //!< way to save name/value pairs. Note there is no encryption involved in this
VWebSubPages m_vSubPages;
- map<CString, CModCommand> m_mCommands;
+ std::map<CString, CModCommand> m_mCommands;
};
-class CModules : public vector<CModule*> {
+class CModules : public std::vector<CModule*> {
public:
CModules();
~CModules();
@@ -1060,8 +1058,8 @@ class CModules : public vector<CModule*> {
bool OnModNotice(const CString& sMessage);
bool OnModCTCP(const CString& sMessage);
- bool OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans);
- bool OnNick(const CNick& Nick, const CString& sNewNick, const vector<CChan*>& vChans);
+ bool OnQuit(const CNick& Nick, const CString& sMessage, const std::vector<CChan*>& vChans);
+ bool OnNick(const CNick& Nick, const CString& sNewNick, const std::vector<CChan*>& vChans);
bool OnKick(const CNick& Nick, const CString& sOpNick, CChan& Channel, const CString& sMessage);
bool OnJoin(const CNick& Nick, CChan& Channel);
bool OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage);
@@ -1108,7 +1106,7 @@ class CModules : public vector<CModule*> {
static bool GetModInfo(CModInfo& ModInfo, const CString& sModule, CString &sRetMsg);
static bool GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const CString& sModPath, CString &sRetMsg);
- static void GetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType = CModInfo::UserModule);
+ static void GetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType = CModInfo::UserModule);
// This returns the path to the .so and to the data dir
// which is where static data (webadmin skins) are saved
@@ -1134,7 +1132,7 @@ class CModules : public vector<CModule*> {
bool OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg);
bool OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg);
- bool OnGetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType);
+ bool OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType);
// !Global Modules
private:
View
@@ -11,12 +11,8 @@
#include <znc/zncconfig.h>
#include <znc/ZNCString.h>
-#include <set>
#include <vector>
-using std::vector;
-using std::set;
-
// Forward Decl
class CIRCNetwork;
class CChan;
@@ -32,7 +28,7 @@ class CNick
void Reset();
void Parse(const CString& sNickMask);
CString GetHostMask() const;
- unsigned int GetCommonChans(vector<CChan*>& vChans, CIRCNetwork* pNetwork) const;
+ unsigned int GetCommonChans(std::vector<CChan*>& vChans, CIRCNetwork* pNetwork) const;
// Setters
void SetNetwork(CIRCNetwork* pNetwork);
Oops, something went wrong.

0 comments on commit 62c9ac1

Please sign in to comment.