From 273d72c60557000811fb9502f700245803cf2799 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 29 Sep 2008 14:46:06 +0000 Subject: [PATCH] Add a Clear() function to CTable and make the base class protected git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1230 726aef4b-f618-498e-8847-2d620e286838 --- Utils.cpp | 5 +++++ Utils.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index a89525ad..3ced88cb 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -543,6 +543,11 @@ unsigned int CTable::GetColumnWidth(unsigned int uIdx) const { return it->second; } +void CTable::Clear() { + clear(); + m_vsHeaders.clear(); + m_msuWidths.clear(); +} #ifdef HAVE_LIBSSL CBlowfish::CBlowfish(const CString & sPassword, int iEncrypt, const CString & sIvec) { diff --git a/Utils.h b/Utils.h index 3aa89e98..eedca532 100644 --- a/Utils.h +++ b/Utils.h @@ -199,7 +199,7 @@ protected: }; -class CTable : public vector > { +class CTable : protected vector > { public: CTable() {} virtual ~CTable() {} @@ -210,6 +210,9 @@ public: bool GetLine(unsigned int uIdx, CString& sLine) const; unsigned int GetColumnWidth(unsigned int uIdx) const; + + void Clear(); + using vector >::size; private: unsigned int GetColumnIndex(const CString& sName) const;