Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / afssvrcfg / char_conv.cpp
blob7b5f371c6a11bd779520af71d78b570ed059bc9a
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 */
11 * INCLUDES _________________________________________________________________
14 #include <WINNT\afsapplib.h>
15 #include <char_conv.h>
20 * Class to convert a TCHAR string to an ANSI string.
22 S2A::S2A(LPCTSTR pszUnicode)
24 m_pszAnsi = StringToAnsi(pszUnicode);
27 S2A::~S2A()
29 // Only need to free the string if a conversion was performed
30 #ifdef UNICODE
31 if (m_pszAnsi)
32 FreeString(m_pszAnsi);
33 #endif
38 * Class to convert an ANSI string to a TCHAR string. If UNICODE is defined,
39 * then the TCHAR string will be a UNICODE string, otherwise it will be an
40 * ANSI string.
42 A2S::A2S(const char *pszAnsi)
44 m_pszUnicode = AnsiToString(pszAnsi);
47 A2S::~A2S()
49 // Only need to free the string if a conversion was performed
50 #ifdef UNICODE
51 if (m_pszUnicode)
52 FreeString(m_pszUnicode);
53 #endif