[pywin32-checkins] /hgroot/pywin32/pywin32: Move TmpWCHAR into Pywintypes.h
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2012-08-18 16:19:57
|
changeset 1f6c4ba7e469 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=1f6c4ba7e469 summary: Move TmpWCHAR into Pywintypes.h diffstat: com/win32comext/propsys/src/PyPROPVARIANT.h | 17 ----------------- win32/src/PyWinTypes.h | 19 +++++++++++++++++++ win32/src/win32evtlog.i | 18 ------------------ win32/src/win32service.i | 17 ----------------- 4 files changed, 19 insertions(+), 52 deletions(-) diffs (111 lines): diff -r 7db23de8daa7 -r 1f6c4ba7e469 com/win32comext/propsys/src/PyPROPVARIANT.h --- a/com/win32comext/propsys/src/PyPROPVARIANT.h Mon Aug 13 18:24:08 2012 -0400 +++ b/com/win32comext/propsys/src/PyPROPVARIANT.h Thu Aug 16 17:55:01 2012 -0400 @@ -4,23 +4,6 @@ #include "structmember.h" #include "propsys.h" -// Automatically freed WCHAR that can be used anywhere WCHAR * is required -class TmpWCHAR -{ -public: - WCHAR *tmp; - TmpWCHAR() { tmp=NULL; } - TmpWCHAR(WCHAR *t) { tmp=t; } - WCHAR * operator= (WCHAR *t){ - PyWinObject_FreeWCHAR(tmp); - tmp=t; - return t; - } - WCHAR ** operator& () {return &tmp;} - boolean operator== (WCHAR *t) { return tmp==t; } - operator WCHAR *() { return tmp; } - ~TmpWCHAR() { PyWinObject_FreeWCHAR(tmp); } -}; extern BOOL PyWin_NewPROPVARIANT(PyObject *ob, VARTYPE vt, PROPVARIANT *ppv); extern BOOL PyWinObject_AsPROPVARIANT(PyObject *ob, PROPVARIANT **pppv); diff -r 7db23de8daa7 -r 1f6c4ba7e469 win32/src/PyWinTypes.h --- a/win32/src/PyWinTypes.h Mon Aug 13 18:24:08 2012 -0400 +++ b/win32/src/PyWinTypes.h Thu Aug 16 17:55:01 2012 -0400 @@ -287,6 +287,25 @@ PYWINTYPES_EXPORT void PyWinObject_FreeString(char *pResult); PYWINTYPES_EXPORT void PyWinObject_FreeString(WCHAR *pResult); +// Automatically freed WCHAR that can be used anywhere WCHAR * is required +class TmpWCHAR +{ +public: + WCHAR *tmp; + TmpWCHAR() { tmp=NULL; } + TmpWCHAR(WCHAR *t) { tmp=t; } + WCHAR * operator= (WCHAR *t){ + PyWinObject_FreeWCHAR(tmp); + tmp=t; + return t; + } + WCHAR ** operator& () {return &tmp;} + boolean operator== (WCHAR *t) { return tmp==t; } + operator WCHAR *() { return tmp; } + ~TmpWCHAR() { PyWinObject_FreeWCHAR(tmp); } +}; + + // Buffer functions that can be used in place of 's#' input format or PyString_AsStringAndSize // for 64-bit compatibility and API consistency PYWINTYPES_EXPORT BOOL PyWinObject_AsReadBuffer(PyObject *ob, void **buf, DWORD *buf_len, BOOL bNoneOk=FALSE); diff -r 7db23de8daa7 -r 1f6c4ba7e469 win32/src/win32evtlog.i --- a/win32/src/win32evtlog.i Mon Aug 13 18:24:08 2012 -0400 +++ b/win32/src/win32evtlog.i Thu Aug 16 17:55:01 2012 -0400 @@ -15,24 +15,6 @@ #include "PyWinObjects.h" #include "WinEvt.h" -// Automatically freed WCHAR that can be used anywhere WCHAR * is required -class TmpWCHAR -{ -public: - WCHAR *tmp; - TmpWCHAR() { tmp=NULL; } - TmpWCHAR(WCHAR *t) { tmp=t; } - WCHAR * operator= (WCHAR *t){ - PyWinObject_FreeWCHAR(tmp); - tmp=t; - return t; - } - WCHAR ** operator& () {return &tmp;} - boolean operator== (WCHAR *t) { return tmp==t; } - operator WCHAR *() { return tmp; } - ~TmpWCHAR() { PyWinObject_FreeWCHAR(tmp); } -}; - // @object PyEVTLOG_HANDLE|Object representing a handle to the windows event log. // Identical to <o PyHANDLE>, but calls CloseEventLog() on destruction class PyEVTLOG_HANDLE: public PyHANDLE diff -r 7db23de8daa7 -r 1f6c4ba7e469 win32/src/win32service.i --- a/win32/src/win32service.i Mon Aug 13 18:24:08 2012 -0400 +++ b/win32/src/win32service.i Thu Aug 16 17:55:01 2012 -0400 @@ -24,23 +24,6 @@ // according to msdn, 256 is limit for service names and service display names #define MAX_SERVICE_NAME_LEN 256 -// Automatically freed WCHAR that can be used anywhere WCHAR * is required -class TmpWCHAR -{ -public: - WCHAR *tmp; - TmpWCHAR() { tmp=NULL; } - TmpWCHAR(WCHAR *t) { tmp=t; } - WCHAR * operator= (WCHAR *t){ - PyWinObject_FreeWCHAR(tmp); - tmp=t; - return t; - } - WCHAR ** operator& () {return &tmp;} - boolean operator== (WCHAR *t) { return tmp==t; } - operator WCHAR *() { return tmp; } - ~TmpWCHAR() { PyWinObject_FreeWCHAR(tmp); } -}; %} %init %{ |