diff --git a/include/znc/Buffer.h b/include/znc/Buffer.h index 2da9a193..c358eaf9 100644 --- a/include/znc/Buffer.h +++ b/include/znc/Buffer.h @@ -20,6 +20,7 @@ class CClient; class CBufLine { public: + CBufLine() { throw 0; } // shouldn't be called, but is needed for compilation CBufLine(const CString& sFormat, const CString& sText = "", const timeval* ts = 0); ~CBufLine(); CString GetLine(const CClient& Client, const MCString& msParams) const; @@ -46,6 +47,8 @@ protected: class CBuffer : private std::deque { public: + typedef typename std::deque::size_type size_type; + CBuffer(unsigned int uLineCount = 100); ~CBuffer(); diff --git a/include/znc/Utils.h b/include/znc/Utils.h index fe3d2752..54716560 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -123,6 +123,8 @@ protected: */ class CTable : protected std::vector > { public: + typedef typename std::vector >::size_type size_type; + CTable() {} virtual ~CTable() {} diff --git a/modules/modperl/CString.i b/modules/modperl/CString.i index 9a1fcbb9..bd156588 100644 --- a/modules/modperl/CString.i +++ b/modules/modperl/CString.i @@ -11,7 +11,10 @@ %feature("naturalvar") CString; -class CString; +class CString { +public: + typedef size_t size_type; +}; /*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/ diff --git a/modules/modperl/modperl.i b/modules/modperl/modperl.i index a3a3c0c6..c1fde82f 100644 --- a/modules/modperl/modperl.i +++ b/modules/modperl/modperl.i @@ -37,6 +37,7 @@ #include "../include/znc/FileUtils.h" #include "../include/znc/ZNCDebug.h" #include "../include/znc/ExecSock.h" +#include "../include/znc/Buffer.h" #include "modperl/module.h" #define stat struct stat %} @@ -50,6 +51,7 @@ %include %include %include +%include namespace std { template class set { @@ -78,6 +80,8 @@ namespace std { %template(VIRCNetworks) std::vector; %template(VChannels) std::vector; +%template(VCString) std::vector; +typedef std::vector VCString; /*%template(MNicks) std::map;*/ /*%template(SModInfo) std::set; %template(SCString) std::set; @@ -86,6 +90,8 @@ typedef std::set SCString;*/ class MCString : public std::map {}; /*%template(PerlModulesVector) std::vector;*/ %template(VListeners) std::vector; +%template(BufLines) std::deque; +%template(VVString) std::vector; %typemap(out) std::map { HV* myhv = newHV(); @@ -124,6 +130,7 @@ class MCString : public std::map {}; %include "../include/znc/Server.h" %include "../include/znc/ZNCDebug.h" %include "../include/znc/ExecSock.h" +%include "../include/znc/Buffer.h" %include "modperl/module.h" diff --git a/modules/modpython/cstring.i b/modules/modpython/cstring.i index 8afb4348..16ea53da 100644 --- a/modules/modpython/cstring.i +++ b/modules/modpython/cstring.i @@ -11,7 +11,10 @@ %} %feature("naturalvar") CString; -class CString; +class CString { +public: +typedef size_t size_type; +}; /*@SWIG:/usr/share/swig1.3/typemaps/std_strings.swg,74,%typemaps_std_string@*/ diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index 53ba0435..56d9c65f 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -48,6 +48,7 @@ using std::allocator; %include %include %include +%include %include "modpython/cstring.i" %template(_stringlist) std::list; @@ -67,11 +68,15 @@ using std::allocator; %template(SModInfo) std::set; %template(SCString) std::set; typedef std::set SCString; +%template(VCString) std::vector; +typedef std::vector VCString; %template(PyMCString) std::map; %template(PyMStringVString) std::map; class MCString : public std::map {}; %template(PyModulesVector) std::vector; %template(VListeners) std::vector; +%template(BufLines) std::deque; +%template(VVString) std::vector; %typemap(in) CString& { String* p;