main
h 30 lines 700 Bytes
Raw
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
6 class PSCZ
7 {
8 public:
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
27 private:
28 LPWSTR m_scz;
29 };
30 #endif //__cplusplus