Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / afssvrcfg / char_conv.h
blob0b81873c839061137024ada025f16fcc371e9d44
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
10 #ifndef _H_CHAR_CONVERSION_H_
11 #define _H_CHAR_CONVERSION_H_
15 * Class to convert a TCHAR string to an ANSI string.
17 class S2A
19 char *m_pszAnsi;
21 public:
22 S2A(LPCTSTR pszUnicode);
23 ~S2A();
25 // Allow casts to char *
26 operator char *() const { return m_pszAnsi; }
27 operator const char *() const { return m_pszAnsi; }
33 * Class to convert an ANSI string to a TCHAR string. If UNICODE is defined,
34 * then the TCHAR string will be a UNICODE string, otherwise it will be an
35 * ANSI string.
37 class A2S
39 LPTSTR m_pszUnicode;
41 public:
42 A2S(const char *pszAnsi);
43 ~A2S();
45 // Allow casts to LPTSTR
46 operator LPTSTR() const { return m_pszUnicode; }
47 operator LPCTSTR() const { return m_pszUnicode; }
50 #endif // _H_CHAR_CONVERSION_H_