aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/sczutil.h')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/sczutil.h30
1 files changed, 30 insertions, 0 deletions
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 @@
1#pragma once
2// 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.
3
4
5#ifdef __cplusplus
6class PSCZ
7{
8public:
9 PSCZ() : m_scz(NULL) { }
10
11 ~PSCZ() { ReleaseNullStr(m_scz); }
12
13 operator LPWSTR() { return m_scz; }
14
15 operator LPCWSTR() { return m_scz; }
16
17 operator bool() { return NULL != m_scz; }
18
19 LPWSTR* operator &() { return &m_scz; }
20
21 bool operator !() { return !m_scz; }
22
23 WCHAR operator *() { return *m_scz; }
24
25 LPWSTR Detach() { LPWSTR scz = m_scz; m_scz = NULL; return scz; }
26
27private:
28 LPWSTR m_scz;
29};
30#endif //__cplusplus