From 0840525a0d27688e853478b0e519abe67ec7941f Mon Sep 17 00:00:00 2001 From: prozacx Date: Tue, 2 Aug 2005 17:45:57 +0000 Subject: [PATCH] Added GetParamValues() overload which returns a set instead of vector git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@457 726aef4b-f618-498e-8847-2d620e286838 --- HTTPSock.cpp | 14 ++++++++++++++ HTTPSock.h | 1 + 2 files changed, 15 insertions(+) diff --git a/HTTPSock.cpp b/HTTPSock.cpp index 07924c8d..539cf176 100644 --- a/HTTPSock.cpp +++ b/HTTPSock.cpp @@ -139,6 +139,20 @@ CString CHTTPSock::GetParam(const CString& sName) const { return sRet; } +unsigned int CHTTPSock::GetParamValues(const CString& sName, set& ssRet) const { + ssRet.clear(); + + map::const_iterator it = m_msvsParams.find(sName); + + if (it != m_msvsParams.end()) { + for (unsigned int a = 0; a < it->second.size(); a++) { + ssRet.insert(it->second[a]); + } + } + + return ssRet.size(); +} + unsigned int CHTTPSock::GetParamValues(const CString& sName, VCString& vsRet) const { vsRet.clear(); diff --git a/HTTPSock.h b/HTTPSock.h index ab0a238e..f97a9afd 100644 --- a/HTTPSock.h +++ b/HTTPSock.h @@ -49,6 +49,7 @@ public: const CString& GetPass() const; const CString& GetParamString() const; unsigned int GetParamValues(const CString& sName, VCString& vsRet) const; + unsigned int GetParamValues(const CString& sName, set& ssRet) const; const map& GetParams() const; // !Getters private: