diff --git a/include/znc/Buffer.h b/include/znc/Buffer.h index c99b7d02..b55a6a66 100644 --- a/include/znc/Buffer.h +++ b/include/znc/Buffer.h @@ -13,8 +13,6 @@ #include #include -using std::deque; - // Forward Declarations class CClient; // !Forward Declarations @@ -45,7 +43,7 @@ protected: time_t m_tm; }; -class CBuffer : private deque { +class CBuffer : private std::deque { public: CBuffer(unsigned int uLineCount = 100); ~CBuffer(); diff --git a/include/znc/Chan.h b/include/znc/Chan.h index 128c7a9f..863100d1 100644 --- a/include/znc/Chan.h +++ b/include/znc/Chan.h @@ -14,12 +14,6 @@ #include #include #include -#include -#include - -using std::vector; -using std::map; -using std::set; // Forward Declarations class CUser; @@ -126,16 +120,16 @@ public: bool HasMode(unsigned char uMode) const; CString GetOptions() const; CString GetModeArg(unsigned char uMode) const; - map GetPermCounts() const; + std::map GetPermCounts() const; bool IsOn() const { return m_bIsOn; } const CString& GetName() const { return m_sName; } - const map& GetModes() const { return m_musModes; } + const std::map& 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& GetNicks() const { return m_msNicks; } + const std::map& 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 @@ protected: CNick m_Nick; unsigned int m_uJoinTries; CString m_sDefaultModes; - map m_msNicks; // Todo: make this caseless (irc style) + std::map m_msNicks; // Todo: make this caseless (irc style) CBuffer m_Buffer; bool m_bModeKnown; - map m_musModes; + std::map m_musModes; }; #endif // !_CHAN_H diff --git a/include/znc/Client.h b/include/znc/Client.h index 1653352b..b6464c63 100644 --- a/include/znc/Client.h +++ b/include/znc/Client.h @@ -138,7 +138,7 @@ public: CUser* GetUser() const { return m_pUser; } void SetNetwork(CIRCNetwork* pNetwork, bool bDisconnect=true, bool bReconnect=true); CIRCNetwork* GetNetwork() const { return m_pNetwork; } - vector& GetClients(); + std::vector& GetClients(); const CIRCSock* GetIRCSock() const; CIRCSock* GetIRCSock(); CString GetFullName(); diff --git a/include/znc/Config.h b/include/znc/Config.h index e66ee76c..0e8698c9 100644 --- a/include/znc/Config.h +++ b/include/znc/Config.h @@ -27,9 +27,9 @@ struct CConfigEntry { class CConfig { public: - typedef map EntryMap; - typedef map SubConfig; - typedef map SubConfigMap; + typedef std::map EntryMap; + typedef std::map SubConfig; + typedef std::map SubConfigMap; typedef EntryMap::const_iterator EntryMapIterator; typedef SubConfigMap::const_iterator SubConfigMapIterator; diff --git a/include/znc/FileUtils.h b/include/znc/FileUtils.h index 567ba218..2d6ba736 100644 --- a/include/znc/FileUtils.h +++ b/include/znc/FileUtils.h @@ -12,16 +12,12 @@ #include #include #include -#include #include #include #include #include #include -using std::vector; -using std::map; - class CFile { public: CFile(); @@ -143,7 +139,7 @@ protected: CString m_sShortName; //!< Filename alone, without path }; -class CDir : public vector { +class CDir : public std::vector { public: CDir(const CString& sDir) { diff --git a/include/znc/HTTPSock.h b/include/znc/HTTPSock.h index 749eafe1..cc6b69d9 100644 --- a/include/znc/HTTPSock.h +++ b/include/znc/HTTPSock.h @@ -43,7 +43,7 @@ public: 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& msvsParams); + static void ParseParams(const CString& sParams, std::map& msvsParams); void ParseURI(); void GetPage(); static CString GetDate(time_t tm = 0); @@ -73,15 +73,15 @@ public: 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& GetParams(bool bPost = true) const; + const std::map& 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& ssRet, bool bPost = true, const CString& sFilter = "\r\n") const; + unsigned int GetParamValues(const CString& sName, std::set& ssRet, bool bPost = true, const CString& sFilter = "\r\n") const; // !Parameter access private: - static CString GetRawParam(const CString& sName, const map& msvsParams); - static CString GetParam(const CString& sName, const map& msvsParams, const CString& sFilter); - static unsigned int GetParamValues(const CString& sName, VCString& vsRet, const map& msvsParams, const CString& sFilter); - static unsigned int GetParamValues(const CString& sName, set& ssRet, const map& msvsParams, const CString& sFilter); + static CString GetRawParam(const CString& sName, const std::map& msvsParams); + static CString GetParam(const CString& sName, const std::map& msvsParams, const CString& sFilter); + static unsigned int GetParamValues(const CString& sName, VCString& vsRet, const std::map& msvsParams, const CString& sFilter); + static unsigned int GetParamValues(const CString& sName, std::set& ssRet, const std::map& msvsParams, const CString& sFilter); protected: void PrintPage(const CString& sPage); @@ -99,8 +99,8 @@ protected: CString m_sPass; CString m_sContentType; CString m_sDocRoot; - map m_msvsPOSTParams; - map m_msvsGETParams; + std::map m_msvsPOSTParams; + std::map m_msvsGETParams; MCString m_msHeaders; bool m_bHTTP10Client; CString m_sIfNoneMatch; diff --git a/include/znc/IRCNetwork.h b/include/znc/IRCNetwork.h index fbb05391..bcedb9af 100644 --- a/include/znc/IRCNetwork.h +++ b/include/znc/IRCNetwork.h @@ -52,7 +52,7 @@ public: CUser* GetUser(); const CString& GetName() const; bool IsNetworkAttached() const { return !m_vClients.empty(); }; - vector& GetClients() { return m_vClients; } + std::vector& GetClients() { return m_vClients; } void SetUser(CUser *pUser); bool SetName(const CString& sName); @@ -66,7 +66,7 @@ public: 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& GetChans() const; + const std::vector& GetChans() const; CChan* FindChan(const CString& sName) const; bool AddChan(CChan* pChan); bool AddChan(const CString& sName, bool bInConfig); @@ -77,7 +77,7 @@ public: void SetChanPrefixes(const CString& s) { m_sChanPrefixes = s; }; bool IsChan(const CString& sChan) const; - const vector& GetServers() const; + const std::vector& 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 @@ protected: CModules* m_pModules; - vector m_vClients; + std::vector m_vClients; CIRCSock* m_pIRCSock; - vector m_vChans; + std::vector m_vChans; CString m_sChanPrefixes; bool m_bIRCConnectEnabled; CString m_sIRCServer; - vector m_vServers; + std::vector m_vServers; unsigned int m_uServerIdx; ///< Index in m_vServers of our current server + 1 CNick m_IRCNick; diff --git a/include/znc/IRCSock.h b/include/znc/IRCSock.h index 265c5612..2c378314 100644 --- a/include/znc/IRCSock.h +++ b/include/znc/IRCSock.h @@ -14,7 +14,6 @@ #include #include -using std::deque; // Forward Declarations class CChan; @@ -79,7 +78,7 @@ public: unsigned int GetMaxNickLen() const { return m_uMaxNickLen; } EChanModeArgs GetModeType(unsigned char uMode) const; unsigned char GetPermFromMode(unsigned char uMode) const; - const map& GetChanModes() const { return m_mueChanModes; } + const std::map& 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 @@ public: CIRCNetwork* GetNetwork() const { return m_pNetwork; } bool HasNamesx() const { return m_bNamesx; } bool HasUHNames() const { return m_bUHNames; } - const set& GetUserModes() const { return m_scUserModes; } + const std::set& 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 @@ protected: bool m_bUHNames; CString m_sPerms; CString m_sPermModes; - set m_scUserModes; - map m_mueChanModes; + std::set m_scUserModes; + std::map m_mueChanModes; CIRCNetwork* m_pNetwork; CNick m_Nick; CString m_sPass; - map m_msChans; + std::map m_msChans; unsigned int m_uMaxNickLen; unsigned int m_uCapPaused; SCString m_ssAcceptedCaps; @@ -131,7 +130,7 @@ protected: static const time_t m_uCTCPFloodTime; static const unsigned int m_uCTCPFloodCount; MCString m_mISupport; - deque m_vsSendQueue; + std::deque m_vsSendQueue; short int m_iSendsAllowed; unsigned short int m_uFloodBurst; double m_fFloodRate; diff --git a/include/znc/Modules.h b/include/znc/Modules.h index 73f455ef..d347fb4d 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -15,8 +15,6 @@ #include #include -using std::set; - // Forward Declarations class CAuthBase; class CChan; @@ -237,7 +235,7 @@ public: // !Setters private: protected: - set m_seType; + std::set m_seType; EModuleType m_eDefaultType; CString m_sName; CString m_sPath; @@ -539,14 +537,14 @@ public: * @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& vChans); + virtual void OnQuit(const CNick& Nick, const CString& sMessage, const std::vector& 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& vChans); + virtual void OnNick(const CNick& Nick, const CString& sNewNick, const std::vector& 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 @@ public: bool RemTimer(const CString& sLabel); bool UnlinkTimer(CTimer* pTimer); CTimer* FindTimer(const CString& sLabel); - set::const_iterator BeginTimers() const { return m_sTimers.begin(); } - set::const_iterator EndTimers() const { return m_sTimers.end(); } + std::set::const_iterator BeginTimers() const { return m_sTimers.begin(); } + std::set::const_iterator EndTimers() const { return m_sTimers.end(); } virtual void ListTimers(); // !Timer stuff @@ -835,8 +833,8 @@ public: bool RemSocket(const CString& sSockName); bool UnlinkSocket(CSocket* pSocket); CSocket* FindSocket(const CString& sSockName); - set::const_iterator BeginSockets() const { return m_sSockets.begin(); } - set::const_iterator EndSockets() const { return m_sSockets.end(); } + std::set::const_iterator BeginSockets() const { return m_sSockets.begin(); } + std::set::const_iterator EndSockets() const { return m_sSockets.end(); } virtual void ListSockets(); // !Socket stuff @@ -997,14 +995,14 @@ public: * @param ssMods put new modules here. * @param bGlobal true if global modules are needed. */ - virtual void OnGetAvailableMods(set& ssMods, CModInfo::EModuleType eType); + virtual void OnGetAvailableMods(std::set& ssMods, CModInfo::EModuleType eType); // !Global Modules protected: CModInfo::EModuleType m_eType; CString m_sDescription; - set m_sTimers; - set m_sSockets; + std::set m_sTimers; + std::set m_sSockets; ModHandle m_pDLL; CSockManager* m_pManager; CUser* m_pUser; @@ -1018,10 +1016,10 @@ protected: private: MCString m_mssRegistry; //!< way to save name/value pairs. Note there is no encryption involved in this VWebSubPages m_vSubPages; - map m_mCommands; + std::map m_mCommands; }; -class CModules : public vector { +class CModules : public std::vector { public: CModules(); ~CModules(); @@ -1060,8 +1058,8 @@ public: bool OnModNotice(const CString& sMessage); bool OnModCTCP(const CString& sMessage); - bool OnQuit(const CNick& Nick, const CString& sMessage, const vector& vChans); - bool OnNick(const CNick& Nick, const CString& sNewNick, const vector& vChans); + bool OnQuit(const CNick& Nick, const CString& sMessage, const std::vector& vChans); + bool OnNick(const CNick& Nick, const CString& sNewNick, const std::vector& 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 @@ public: 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& ssMods, CModInfo::EModuleType eType = CModInfo::UserModule); + static void GetAvailableMods(std::set& 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 @@ public: bool OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg); bool OnGetModInfo(CModInfo& ModInfo, const CString& sModule, bool& bSuccess, CString& sRetMsg); - bool OnGetAvailableMods(set& ssMods, CModInfo::EModuleType eType); + bool OnGetAvailableMods(std::set& ssMods, CModInfo::EModuleType eType); // !Global Modules private: diff --git a/include/znc/Nick.h b/include/znc/Nick.h index 182c3a7e..28be66a1 100644 --- a/include/znc/Nick.h +++ b/include/znc/Nick.h @@ -11,12 +11,8 @@ #include #include -#include #include -using std::vector; -using std::set; - // Forward Decl class CIRCNetwork; class CChan; @@ -32,7 +28,7 @@ public: void Reset(); void Parse(const CString& sNickMask); CString GetHostMask() const; - unsigned int GetCommonChans(vector& vChans, CIRCNetwork* pNetwork) const; + unsigned int GetCommonChans(std::vector& vChans, CIRCNetwork* pNetwork) const; // Setters void SetNetwork(CIRCNetwork* pNetwork); diff --git a/include/znc/Template.h b/include/znc/Template.h index 43676fba..8f02135d 100644 --- a/include/znc/Template.h +++ b/include/znc/Template.h @@ -12,9 +12,7 @@ #include #include #include - -using std::ostream; -using std::endl; +#include class CTemplate; @@ -65,7 +63,7 @@ private: class CTemplateLoopContext { public: - CTemplateLoopContext(unsigned long uFilePos, const CString& sLoopName, bool bReverse, vector* pRows) { + CTemplateLoopContext(unsigned long uFilePos, const CString& sLoopName, bool bReverse, std::vector* pRows) { m_uFilePosition = uFilePos; m_sName = sLoopName; m_uRowIndex = 0; @@ -91,7 +89,7 @@ public: unsigned long GetFilePosition() const { return m_uFilePosition; } unsigned int GetRowIndex() const { return m_uRowIndex; } unsigned int GetRowCount() { return m_pvRows->size(); } - vector* GetRows() { return m_pvRows; } + std::vector* GetRows() { return m_pvRows; } CTemplate* GetNextRow() { return GetRow(IncRowIndex()); } CTemplate* GetCurRow() { return GetRow(m_uRowIndex); } @@ -104,7 +102,7 @@ private: CString m_sName; //!< The name portion of the tag unsigned int m_uRowIndex; //!< The index of the current row we're on unsigned long m_uFilePosition; //!< The file position of the opening tag - vector* m_pvRows; //!< This holds pointers to the templates associated with this loop + std::vector* m_pvRows; //!< This holds pointers to the templates associated with this loop }; @@ -130,7 +128,7 @@ public: m_vspTagHandlers.push_back(spTagHandler); } - vector >& GetTagHandlers() { + std::vector >& GetTagHandlers() { if (m_pParent) { return m_pParent->GetTagHandlers(); } @@ -153,8 +151,8 @@ public: void RemovePath(const CString& sPath); void ClearPaths(); bool PrintString(CString& sRet); - bool Print(ostream& oOut); - bool Print(const CString& sFileName, ostream& oOut); + bool Print(std::ostream& oOut); + bool Print(const CString& sFileName, std::ostream& oOut); bool ValidIf(const CString& sArgs); bool ValidExpr(const CString& sExpr); bool IsTrue(const CString& sName); @@ -162,7 +160,7 @@ public: CString GetValue(const CString& sName, bool bFromIf = false); CTemplate& AddRow(const CString& sName); CTemplate* GetRow(const CString& sName, unsigned int uIndex); - vector* GetLoop(const CString& sName); + std::vector* GetLoop(const CString& sName); void DelCurLoopContext(); CTemplateLoopContext* GetCurLoopContext(); CTemplate* GetCurTemplate(); @@ -173,11 +171,11 @@ public: private: CTemplate* m_pParent; CString m_sFileName; - list > m_lsbPaths; - map > m_mvLoops; - vector m_vLoopContexts; + std::list > m_lsbPaths; + std::map > m_mvLoops; + std::vector m_vLoopContexts; CSmartPtr m_spOptions; - vector > m_vspTagHandlers; + std::vector > m_vspTagHandlers; }; #endif // !_TEMPLATE_H diff --git a/include/znc/User.h b/include/znc/User.h index 7b4b99a2..db86b95f 100644 --- a/include/znc/User.h +++ b/include/znc/User.h @@ -16,9 +16,6 @@ #include #include -using std::set; -using std::vector; - class CModules; class CChan; class CClient; @@ -69,7 +66,7 @@ public: bool AddNetwork(CIRCNetwork *pNetwork); void RemoveNetwork(CIRCNetwork *pNetwork); CIRCNetwork* FindNetwork(const CString& sNetwork) const; - const vector& GetNetworks() const; + const std::vector& GetNetworks() const; // !Networks bool PutUser(const CString& sLine, CClient* pClient = NULL, CClient* pSkipClient = NULL); @@ -128,8 +125,8 @@ public: // !Setters // Getters - vector& GetUserClients() { return m_vClients; } - vector GetAllClients(); + std::vector& GetUserClients() { return m_vClients; } + std::vector GetAllClients(); const CString& GetUserName() const; const CString& GetCleanUserName() const; const CString& GetNick(bool bAllowDefault = true) const; @@ -141,7 +138,7 @@ public: const CString& GetPass() const; eHashType GetPassHashType() const; const CString& GetPassSalt() const; - const set& GetAllowedHosts() const; + const std::set& GetAllowedHosts() const; const CString& GetTimestampFormat() const; bool GetTimestampAppend() const; bool GetTimestampPrepend() const; @@ -202,9 +199,9 @@ protected: CUserTimer* m_pUserTimer; - vector m_vIRCNetworks; - vector m_vClients; - set m_ssAllowedHosts; + std::vector m_vIRCNetworks; + std::vector m_vClients; + std::set m_ssAllowedHosts; unsigned int m_uBufferCount; unsigned long long m_uBytesRead; unsigned long long m_uBytesWritten; diff --git a/include/znc/Utils.h b/include/znc/Utils.h index 4d467205..0750bb7a 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -20,10 +20,6 @@ #include #include -using std::map; -using std::vector; -using std::pair; - static inline void SetFdCloseOnExec(int fd) { int flags = fcntl(fd, F_GETFD, 0); @@ -125,7 +121,7 @@ protected: | hello | world | +-------+-------+@endverbatim */ -class CTable : protected vector > { +class CTable : protected std::vector > { public: CTable() {} virtual ~CTable() {} @@ -172,16 +168,16 @@ public: void Clear(); /// @return The number of rows in this table, not counting the header. - using vector >::size; + using std::vector >::size; /// @return True if this table doesn't contain any rows. - using vector >::empty; + using std::vector >::empty; private: unsigned int GetColumnIndex(const CString& sName) const; protected: - vector m_vsHeaders; - map m_msuWidths; // Used to cache the width of a column + std::vector m_vsHeaders; + std::map m_msuWidths; // Used to cache the width of a column }; @@ -336,10 +332,10 @@ public: unsigned int GetTTL() const { return m_uTTL; } // !Getters protected: - typedef pair value; - typedef typename map::iterator iterator; - map m_mItems; //!< Map of cached items. The value portion of the map is for the expire time - unsigned int m_uTTL; //!< Default time-to-live duration + typedef std::pair value; + typedef typename std::map::iterator iterator; + std::map m_mItems; //!< Map of cached items. The value portion of the map is for the expire time + unsigned int m_uTTL; //!< Default time-to-live duration }; /** diff --git a/include/znc/WebModules.h b/include/znc/WebModules.h index cdeb87ae..3297a8e2 100644 --- a/include/znc/WebModules.h +++ b/include/znc/WebModules.h @@ -20,7 +20,7 @@ class CModule; class CWebSubPage; typedef CSmartPtr TWebSubPage; -typedef vector VWebSubPages; +typedef std::vector VWebSubPages; class CZNCTagHandler : public CTemplateTagHandler { public: diff --git a/include/znc/ZNCDebug.h b/include/znc/ZNCDebug.h index 0c92d450..9c41e8fc 100644 --- a/include/znc/ZNCDebug.h +++ b/include/znc/ZNCDebug.h @@ -17,9 +17,6 @@ #include #include -using std::cout; -using std::endl; - /** Output a debug info if debugging is enabled. * If ZNC was compiled with --enable-debug or was started with * --debug, the given argument will be sent to stdout. @@ -33,7 +30,7 @@ using std::endl; */ #define DEBUG(f) do { \ if (CDebug::Debug()) { \ - cout << CDebug::GetTimestamp() << f << endl; \ + std::cout << CDebug::GetTimestamp() << f << std::endl; \ } \ } while (0) diff --git a/include/znc/ZNCString.h b/include/znc/ZNCString.h index 477b8f79..bf98e978 100644 --- a/include/znc/ZNCString.h +++ b/include/znc/ZNCString.h @@ -14,16 +14,8 @@ #include #include #include -#include #include -using std::map; -using std::set; -using std::string; -using std::vector; -using std::list; -using std::pair; - #define _SQL(s) CString("'" + CString(s).Escape_n(CString::ESQL) + "'") #define _URL(s) CString(s).Escape_n(CString::EURL) #define _HTML(s) CString(s).Escape_n(CString::EHTML) @@ -32,9 +24,9 @@ using std::pair; class CString; class MCString; -typedef set SCString; -typedef vector VCString; -typedef vector > VPair; +typedef std::set SCString; +typedef std::vector VCString; +typedef std::vector > VPair; static const unsigned char XX = 0xff; static const unsigned char base64_table[256] = { @@ -63,7 +55,7 @@ static const unsigned char base64_table[256] = { * class. It provides helpful functions for parsing input like Token() and * Split(). */ -class CString : public string { +class CString : public std::string { public: typedef enum { EASCII, @@ -73,7 +65,7 @@ public: ENAMEDFMT } EEscape; - explicit CString(bool b) : string(b ? "true" : "false") {} + explicit CString(bool b) : std::string(b ? "true" : "false") {} explicit CString(char c); explicit CString(unsigned char c); explicit CString(short i); @@ -87,11 +79,11 @@ public: explicit CString(double i, int precision = 2); explicit CString(float i, int precision = 2); - CString() : string() {} - CString(const char* c) : string(c) {} - CString(const char* c, size_t l) : string(c, l) {} - CString(const string& s) : string(s) {} - CString(size_t n, char c) : string(n, c) {} + CString() : std::string() {} + CString(const char* c) : std::string(c) {} + CString(const char* c, size_t l) : std::string(c, l) {} + CString(const std::string& s) : std::string(s) {} + CString(size_t n, char c) : std::string(n, c) {} ~CString() {} /** @@ -475,10 +467,10 @@ protected: * * This class maps strings to other strings. */ -class MCString : public map { +class MCString : public std::map { public: /** Construct an empty MCString. */ - MCString() : map() {} + MCString() : std::map() {} /** Destruct this MCString. */ virtual ~MCString() { clear(); } diff --git a/include/znc/znc.h b/include/znc/znc.h index 43087c68..dfdf37e9 100644 --- a/include/znc/znc.h +++ b/include/znc/znc.h @@ -17,9 +17,6 @@ #include #include -using std::map; -using std::list; - class CListener; class CUser; class CIRCNetwork; @@ -99,7 +96,7 @@ public: CSockManager& GetManager() { return m_Manager; } const CSockManager& GetManager() const { return m_Manager; } CModules& GetModules() { return *m_pModules; } - size_t FilterUncommonModules(set& ssModules); + size_t FilterUncommonModules(std::set& ssModules); CString GetSkinName() const { return m_sSkinName; } const CString& GetStatusPrefix() const { return m_sStatusPrefix; } const CString& GetCurPath() const; @@ -112,7 +109,7 @@ public: const CString& GetConfigFile() const { return m_sConfigFile; } bool WritePemFile(); const VCString& GetBindHosts() const { return m_vsBindHosts; } - const vector& GetListeners() const { return m_vpListeners; } + const std::vector& GetListeners() const { return m_vpListeners; } time_t TimeStarted() const { return m_TimeStarted; } unsigned int GetMaxBufferSize() const { return m_uiMaxBufferSize; } unsigned int GetAnonIPLimit() const { return m_uiAnonIPLimit; } @@ -138,7 +135,7 @@ public: bool DeleteUser(const CString& sUsername); bool AddUser(CUser* pUser, CString& sErrorRet); - const map & GetUserMap() const { return(m_msUsers); } + const std::map & GetUserMap() const { return(m_msUsers); } // Listener yummy CListener* FindListener(u_short uPort, const CString& BindHost, EAddrType eAddr); @@ -158,7 +155,7 @@ public: bool GetServerThrottle(CString sName) { return m_sConnectThrottle.GetItem(sName); } void AddNetworkToQueue(CIRCNetwork *pNetwork); - list& GetConnectionQueue() { return m_lpConnectQueue; } + std::list& GetConnectionQueue() { return m_lpConnectQueue; } // This creates a CConnectQueueTimer if we haven't got one yet void EnableConnectQueue(); @@ -185,9 +182,9 @@ protected: time_t m_TimeStarted; enum ConfigState m_eConfigState; - vector m_vpListeners; - map m_msUsers; - map m_msDelUsers; + std::vector m_vpListeners; + std::map m_msUsers; + std::map m_msDelUsers; CSockManager m_Manager; CString m_sCurPath; @@ -207,7 +204,7 @@ protected: CModules* m_pModules; unsigned long long m_uBytesRead; unsigned long long m_uBytesWritten; - list m_lpConnectQueue; + std::list m_lpConnectQueue; CConnectQueueTimer *m_pConnectQueueTimer; unsigned int m_uiConnectPaused; TCacheMap m_sConnectThrottle; diff --git a/modules/admin.cpp b/modules/admin.cpp index a15b42a7..cd743e31 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -16,6 +16,9 @@ #include #include +using std::map; +using std::vector; + template struct array_size_helper { char __place_holder[N]; diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 12ed1f68..84638c5a 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -9,6 +9,8 @@ #include #include +using std::vector; + class CAttachMatch { public: CAttachMatch(const CString& sChannels, const CString& sHostmasks, bool bNegated) diff --git a/modules/autocycle.cpp b/modules/autocycle.cpp index 815040ff..b6a9d7c4 100644 --- a/modules/autocycle.cpp +++ b/modules/autocycle.cpp @@ -10,6 +10,8 @@ #include #include +using std::vector; + class CAutoCycleMod : public CModule { public: MODCONSTRUCTOR(CAutoCycleMod) { diff --git a/modules/autoop.cpp b/modules/autoop.cpp index 692be30f..9ce25f1d 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -9,6 +9,10 @@ #include #include +using std::map; +using std::set; +using std::vector; + class CAutoOpMod; #define AUTOOP_CHALLENGE_LENGTH 32 diff --git a/modules/autovoice.cpp b/modules/autovoice.cpp index 647beda4..4635420b 100644 --- a/modules/autovoice.cpp +++ b/modules/autovoice.cpp @@ -10,6 +10,9 @@ #include #include +using std::map; +using std::set; + class CAutoVoiceUser { public: CAutoVoiceUser() {} diff --git a/modules/awaystore.cpp b/modules/awaystore.cpp index d31a4720..24e1e354 100644 --- a/modules/awaystore.cpp +++ b/modules/awaystore.cpp @@ -22,6 +22,9 @@ #include #include +using std::vector; +using std::map; + #define CRYPT_VERIFICATION_TOKEN "::__:AWAY:__::" class CAway; diff --git a/modules/blockuser.cpp b/modules/blockuser.cpp index bda67dfd..9a502ac9 100644 --- a/modules/blockuser.cpp +++ b/modules/blockuser.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + #define MESSAGE "Your account has been disabled. Contact your administrator." class CBlockUser : public CModule { diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 4b461df0..25060f2b 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -14,6 +14,8 @@ #include #include +using std::set; + class CBounceDCCMod; class CDCCBounce : public CSocket { diff --git a/modules/buffextras.cpp b/modules/buffextras.cpp index 5424d895..45c8b21c 100644 --- a/modules/buffextras.cpp +++ b/modules/buffextras.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + class CBuffExtras : public CModule { public: MODCONSTRUCTOR(CBuffExtras) {} diff --git a/modules/certauth.cpp b/modules/certauth.cpp index 96e6a245..c2a1e3f5 100644 --- a/modules/certauth.cpp +++ b/modules/certauth.cpp @@ -13,6 +13,11 @@ #include #include +using std::map; +using std::vector; +using std::set; +using std::pair; + class CSSLClientCertMod : public CModule { public: MODCONSTRUCTOR(CSSLClientCertMod) { diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index 17dc3a08..1da4b7f4 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + class CChanSaverMod : public CModule { public: MODCONSTRUCTOR(CChanSaverMod) { diff --git a/modules/clearbufferonmsg.cpp b/modules/clearbufferonmsg.cpp index 99ad5e8b..24e503aa 100644 --- a/modules/clearbufferonmsg.cpp +++ b/modules/clearbufferonmsg.cpp @@ -10,6 +10,8 @@ #include #include +using std::vector; + class CClearBufferOnMsgMod : public CModule { public: MODCONSTRUCTOR(CClearBufferOnMsgMod) {} diff --git a/modules/clientnotify.cpp b/modules/clientnotify.cpp index 72d3415c..f84289fc 100644 --- a/modules/clientnotify.cpp +++ b/modules/clientnotify.cpp @@ -9,6 +9,8 @@ #include #include +using std::set; + class CClientNotifyMod : public CModule { protected: CString m_sMethod; diff --git a/modules/dcc.cpp b/modules/dcc.cpp index 2dbc6a4a..fea112e1 100644 --- a/modules/dcc.cpp +++ b/modules/dcc.cpp @@ -12,6 +12,8 @@ #include #include +using std::set; + class CDCCMod; class CDCCSock : public CSocket { diff --git a/modules/disconkick.cpp b/modules/disconkick.cpp index 46480dae..3756f971 100644 --- a/modules/disconkick.cpp +++ b/modules/disconkick.cpp @@ -6,11 +6,12 @@ * by the Free Software Foundation. */ - #include #include #include +using std::vector; + class CKickClientOnIRCDisconnect: public CModule { public: MODCONSTRUCTOR(CKickClientOnIRCDisconnect) {} diff --git a/modules/flooddetach.cpp b/modules/flooddetach.cpp index 63015b8b..03cb2267 100644 --- a/modules/flooddetach.cpp +++ b/modules/flooddetach.cpp @@ -11,6 +11,8 @@ #include #include +using std::map; + class CFloodDetachMod : public CModule { public: MODCONSTRUCTOR(CFloodDetachMod) { diff --git a/modules/keepnick.cpp b/modules/keepnick.cpp index aaddeaea..999013d3 100644 --- a/modules/keepnick.cpp +++ b/modules/keepnick.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + class CKeepNickMod; class CKeepNickTimer : public CTimer { diff --git a/modules/log.cpp b/modules/log.cpp index 398a9e10..370a94c4 100644 --- a/modules/log.cpp +++ b/modules/log.cpp @@ -13,6 +13,8 @@ #include #include +using std::vector; + class CLogMod: public CModule { public: MODCONSTRUCTOR(CLogMod) {} @@ -121,21 +123,21 @@ bool CLogMod::OnLoad(const CString& sArgs, CString& sMessage) // Add default filename to path if it's a folder if (GetType() == CModInfo::UserModule) { - if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$WINDOW") == string::npos || m_sLogPath.find("$NETWORK") == string::npos) { + if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$WINDOW") == CString::npos || m_sLogPath.find("$NETWORK") == CString::npos) { if (!m_sLogPath.empty()) { m_sLogPath += "/"; } m_sLogPath += "$NETWORK_$WINDOW_%Y%m%d.log"; } } else if (GetType() == CModInfo::NetworkModule) { - if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$WINDOW") == string::npos) { + if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$WINDOW") == CString::npos) { if (!m_sLogPath.empty()) { m_sLogPath += "/"; } m_sLogPath += "$WINDOW_%Y%m%d.log"; } } else { - if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$USER") == string::npos || m_sLogPath.find("$WINDOW") == string::npos || m_sLogPath.find("$NETWORK") == string::npos) { + if (m_sLogPath.Right(1) == "/" || m_sLogPath.find("$USER") == CString::npos || m_sLogPath.find("$WINDOW") == CString::npos || m_sLogPath.find("$NETWORK") == CString::npos) { if (!m_sLogPath.empty()) { m_sLogPath += "/"; } diff --git a/modules/modperl.cpp b/modules/modperl.cpp index f2e6cafe..7dd620ad 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -22,6 +22,9 @@ #include "modperl/pstring.h" +using std::set; +using std::vector; + // Allows perl to load .so files when needed by .pm // For example, it needs to load ZNC.so extern "C" { diff --git a/modules/modperl/modperl.i b/modules/modperl/modperl.i index dfb06db8..e7989361 100644 --- a/modules/modperl/modperl.i +++ b/modules/modperl/modperl.i @@ -198,10 +198,10 @@ namespace std { /* Web */ -%template(StrPair) pair; -%template(VPair) vector >; -typedef vector > VPair; -%template(VWebSubPages) vector; +%template(StrPair) std::pair; +%template(VPair) std::vector >; +typedef std::vector > VPair; +%template(VWebSubPages) std::vector; %inline %{ void _VPair_Add2Str(VPair* self, const CString& a, const CString& b) { diff --git a/modules/modperl/module.h b/modules/modperl/module.h index bcfa49b7..46b56574 100644 --- a/modules/modperl/module.h +++ b/modules/modperl/module.h @@ -57,8 +57,8 @@ public: virtual void OnModCommand(const CString& sCommand); virtual void OnModNotice(const CString& sMessage); virtual void OnModCTCP(const CString& sMessage); - virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector& vChans); - virtual void OnNick(const CNick& Nick, const CString& sNewNick, const vector& vChans); + virtual void OnQuit(const CNick& Nick, const CString& sMessage, const std::vector& vChans); + virtual void OnNick(const CNick& Nick, const CString& sNewNick, const std::vector& vChans); virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage); virtual void OnJoin(const CNick& Nick, CChan& Channel); virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage); diff --git a/modules/modpython.cpp b/modules/modpython.cpp index b2716fb2..e0a4bda8 100644 --- a/modules/modpython.cpp +++ b/modules/modpython.cpp @@ -20,6 +20,9 @@ #include "modpython/module.h" #include "modpython/ret.h" +using std::vector; +using std::set; + class CModPython: public CModule { PyObject* m_PyZNCModule; diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index b953f7ca..ceb8d61d 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -249,7 +249,7 @@ private: /* Web */ %template(StrPair) std::pair; -%template(VPair) std::vector >; +%template(VPair) std::vector >; typedef std::vector > VPair; %template(VWebSubPages) std::vector; diff --git a/modules/modpython/module.h b/modules/modpython/module.h index 8d9ae951..d7109656 100644 --- a/modules/modpython/module.h +++ b/modules/modpython/module.h @@ -73,8 +73,8 @@ public: virtual void OnModCommand(const CString& sCommand); virtual void OnModNotice(const CString& sMessage); virtual void OnModCTCP(const CString& sMessage); - virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector& vChans); - virtual void OnNick(const CNick& Nick, const CString& sNewNick, const vector& vChans); + virtual void OnQuit(const CNick& Nick, const CString& sMessage, const std::vector& vChans); + virtual void OnNick(const CNick& Nick, const CString& sNewNick, const std::vector& vChans); virtual void OnKick(const CNick& OpNick, const CString& sKickedNick, CChan& Channel, const CString& sMessage); virtual void OnJoin(const CNick& Nick, CChan& Channel); virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage); diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 52b89dc8..364749eb 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -10,6 +10,10 @@ #include #include +using std::set; +using std::vector; +using std::map; + // If you change these and it breaks, you get to keep the pieces #define CHAN_PREFIX_1 "~" #define CHAN_PREFIX_1C '~' diff --git a/modules/q.cpp b/modules/q.cpp index 53ef75ea..a0429000 100644 --- a/modules/q.cpp +++ b/modules/q.cpp @@ -13,6 +13,8 @@ #include #include +using std::set; + #ifndef Q_DEBUG_COMMUNICATION #define Q_DEBUG_COMMUNICATION 0 #endif diff --git a/modules/sample.cpp b/modules/sample.cpp index 0c9df2b7..edb9a479 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + class CSampleTimer : public CTimer { public: diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index 3524259c..b46b3402 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -21,6 +21,8 @@ #include #include +using std::vector; + #define CRYPT_VERIFICATION_TOKEN "::__:SAVEBUFF:__::" // this is basically plain text, but so is having the pass in the command line so *shrug* // you could at least do something kind of cool like a bunch of unprintable text diff --git a/modules/schat.cpp b/modules/schat.cpp index 545dbcac..0a543541 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -19,6 +19,9 @@ using std::pair; using std::stringstream; +using std::map; +using std::set; +using std::vector; class CSChat; diff --git a/modules/send_raw.cpp b/modules/send_raw.cpp index cab59c17..b0fb02d8 100644 --- a/modules/send_raw.cpp +++ b/modules/send_raw.cpp @@ -10,6 +10,9 @@ #include #include +using std::vector; +using std::map; + class CSendRaw_Mod: public CModule { void SendClient(const CString& sLine) { CUser *pUser = CZNC::Get().FindUser(sLine.Token(1)); diff --git a/modules/shell.cpp b/modules/shell.cpp index 0056b819..8526ee72 100644 --- a/modules/shell.cpp +++ b/modules/shell.cpp @@ -11,6 +11,8 @@ #include #include +using std::vector; + // Forward Declaration class CShellMod; diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 415c2709..225159c1 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -9,6 +9,8 @@ #include #include +using std::vector; + class CStickyChan : public CModule { public: diff --git a/modules/watch.cpp b/modules/watch.cpp index 36283682..66b4c749 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -12,6 +12,7 @@ #include using std::list; +using std::vector; class CWatchSource { public: diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index 63440091..9175a199 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -22,6 +22,9 @@ using std::stringstream; using std::make_pair; +using std::set; +using std::vector; +using std::map; /* Stuff to be able to write this: // i will be name of local variable, see below diff --git a/src/Chan.cpp b/src/Chan.cpp index f3112afa..bca74548 100644 --- a/src/Chan.cpp +++ b/src/Chan.cpp @@ -14,6 +14,10 @@ #include #include +using std::set; +using std::vector; +using std::map; + CChan::CChan(const CString& sName, CIRCNetwork* pNetwork, bool bInConfig, CConfig *pConfig) { m_sName = sName.Token(0); m_sKey = sName.Token(1); diff --git a/src/Client.cpp b/src/Client.cpp index bacebce6..c655aea1 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -15,6 +15,8 @@ #include #include +using std::vector; + #define CALLMOD(MOD, CLIENT, USER, NETWORK, FUNC) { \ CModule *pModule = NULL; \ if (NETWORK && (pModule = (NETWORK)->GetModules().FindModule(MOD))) { \ diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index f888722c..2746eb6f 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -16,6 +16,10 @@ #include #include +using std::vector; +using std::set; +using std::map; + void CClient::UserCommand(CString& sLine) { if (!m_pUser) { return; diff --git a/src/HTTPSock.cpp b/src/HTTPSock.cpp index 915ad9f3..80aae867 100644 --- a/src/HTTPSock.cpp +++ b/src/HTTPSock.cpp @@ -14,6 +14,9 @@ #include #include +using std::map; +using std::set; + #define MAX_POST_SIZE 1024 * 1024 CHTTPSock::CHTTPSock(CModule *pMod) : CSocket(pMod) { diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 9b84367d..0124daf5 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -17,6 +17,9 @@ #include #include +using std::vector; +using std::set; + bool CIRCNetwork::IsValidNetwork(const CString& sNetwork) { // ^[-\w]+$ diff --git a/src/IRCSock.cpp b/src/IRCSock.cpp index 279a187a..c5a49bcb 100644 --- a/src/IRCSock.cpp +++ b/src/IRCSock.cpp @@ -14,6 +14,10 @@ #include #include +using std::set; +using std::vector; +using std::map; + #define IRCSOCKMODULECALL(macFUNC, macEXITER) NETWORKMODULECALL(macFUNC, m_pNetwork->GetUser(), m_pNetwork, NULL, macEXITER) // These are used in OnGeneralCTCP() const time_t CIRCSock::m_uCTCPFloodTime = 5; diff --git a/src/Modules.cpp b/src/Modules.cpp index 8d79eca2..668ac6b3 100644 --- a/src/Modules.cpp +++ b/src/Modules.cpp @@ -15,6 +15,10 @@ #include #include +using std::map; +using std::set; +using std::vector; + #ifndef RTLD_LOCAL # define RTLD_LOCAL 0 # warning "your crap box doesnt define RTLD_LOCAL !?" diff --git a/src/Nick.cpp b/src/Nick.cpp index 2b6640d2..3978ecf8 100644 --- a/src/Nick.cpp +++ b/src/Nick.cpp @@ -11,6 +11,9 @@ #include #include +using std::vector; +using std::map; + CNick::CNick() { Reset(); } diff --git a/src/Template.cpp b/src/Template.cpp index ea164a62..877957da 100644 --- a/src/Template.cpp +++ b/src/Template.cpp @@ -13,6 +13,10 @@ #include using std::stringstream; +using std::vector; +using std::list; +using std::ostream; +using std::pair; void CTemplateOptions::Parse(const CString& sLine) { CString sName = sLine.Token(0, false, "=").Trim_n().AsUpper(); diff --git a/src/User.cpp b/src/User.cpp index e409d5cb..db507844 100644 --- a/src/User.cpp +++ b/src/User.cpp @@ -17,6 +17,9 @@ #include #include +using std::vector; +using std::set; + class CUserTimer : public CCron { public: CUserTimer(CUser* pUser) : CCron() { diff --git a/src/Utils.cpp b/src/Utils.cpp index d6441490..79855e09 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -24,6 +24,7 @@ #include #include +using std::map; using std::stringstream; CUtils::CUtils() {} diff --git a/src/WebModules.cpp b/src/WebModules.cpp index bbc11441..5599052c 100644 --- a/src/WebModules.cpp +++ b/src/WebModules.cpp @@ -13,6 +13,9 @@ #include #include +using std::pair; +using std::vector; + /// @todo Do we want to make this a configure option? #define _SKINDIR_ _DATADIR_ "/webskins" diff --git a/src/main.cpp b/src/main.cpp index f8189b1c..ebb87fd3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,6 +11,10 @@ #include #include +using std::cout; +using std::endl; +using std::set; + #ifdef HAVE_GETOPT_LONG #include #else diff --git a/src/znc.cpp b/src/znc.cpp index bd781909..00a469f2 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -16,6 +16,13 @@ #include #include +using std::endl; +using std::cout; +using std::map; +using std::set; +using std::vector; +using std::list; + static inline CString FormatBindError() { CString sError = (errno == 0 ? CString("unknown error, check the host name") : CString(strerror(errno))); return "Unable to bind [" + sError + "]";