From 7f642e51670bc38a4ef782a363936850bc2b0ba9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 06:38:23 -0700 Subject: Move dutil into libs/dutil --- src/libs/dutil/WixToolset.DUtil/inc/sczutil.h | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/libs/dutil/WixToolset.DUtil/inc/sczutil.h (limited to 'src/libs/dutil/WixToolset.DUtil/inc/sczutil.h') diff --git a/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h b/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h new file mode 100644 index 00000000..fcfbd13a --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h @@ -0,0 +1,30 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#ifdef __cplusplus +class PSCZ +{ +public: + PSCZ() : m_scz(NULL) { } + + ~PSCZ() { ReleaseNullStr(m_scz); } + + operator LPWSTR() { return m_scz; } + + operator LPCWSTR() { return m_scz; } + + operator bool() { return NULL != m_scz; } + + LPWSTR* operator &() { return &m_scz; } + + bool operator !() { return !m_scz; } + + WCHAR operator *() { return *m_scz; } + + LPWSTR Detach() { LPWSTR scz = m_scz; m_scz = NULL; return scz; } + +private: + LPWSTR m_scz; +}; +#endif //__cplusplus -- cgit v1.2.3-55-g6feb