OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
textconv_helper::CW2A_ Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/dev-utils/StackWalker.h>

Collaboration diagram for textconv_helper::CW2A_:

Public Member Functions

 CW2A_ (LPCWSTR pWStr, UINT codePage=CP_ACP)
 ~CW2A_ ()
 operator LPCSTR ()

Private Member Functions

 CW2A_ (const CW2A_ &)
CW2A_ & operator= (const CW2A_ &)

Private Attributes

std::vector< char > m_vAnsiArray
LPCWSTR m_pWStr

Detailed Description

Constructor & Destructor Documentation

◆ CW2A_() [1/2]

textconv_helper::CW2A_::CW2A_ ( LPCWSTR pWStr,
UINT codePage = CP_ACP )
inline
77 : m_pWStr(pWStr)
78 // Usage:
79 // CW2A_ ansiString(L"Some Text");
80 // CW2A_ utf8String(L"Some Text", CP_UTF8);
81 //
82 // or
83 // SetWindowTextA( W2A(L"Some Text") ); The ANSI version of SetWindowText
84 {
85 // Resize the vector and assign null char to each element
86 int length = WideCharToMultiByte(codePage, 0, pWStr, -1, NULL, 0, NULL, NULL) + 1;
87 m_vAnsiArray.assign(length, '\0');
88
89 // Fill our vector with the converted char array
90 WideCharToMultiByte(codePage, 0, pWStr, -1, &m_vAnsiArray[0], length, NULL, NULL);
91 }
std::vector< char > m_vAnsiArray
Definition StackWalker.h:102
LPCWSTR m_pWStr
Definition StackWalker.h:103
double length(const Points &pts)
Definition MultiPoint.hpp:181

References m_pWStr, and m_vAnsiArray.

Referenced by CW2A_(), and operator=().

Here is the caller graph for this function:

◆ ~CW2A_()

textconv_helper::CW2A_::~CW2A_ ( )
inline
94 {
95 m_pWStr = 0;
96 }

References m_pWStr.

◆ CW2A_() [2/2]

textconv_helper::CW2A_::CW2A_ ( const CW2A_ & )
private

References CW2A_().

Here is the call graph for this function:

Member Function Documentation

◆ operator LPCSTR()

textconv_helper::CW2A_::operator LPCSTR ( )
inline
97{ return m_pWStr ? &m_vAnsiArray[0] : NULL; }

References m_pWStr, and m_vAnsiArray.

◆ operator=()

CW2A_ & textconv_helper::CW2A_::operator= ( const CW2A_ & )
private

References CW2A_().

Here is the call graph for this function:

Member Data Documentation

◆ m_pWStr

LPCWSTR textconv_helper::CW2A_::m_pWStr
private

Referenced by CW2A_(), ~CW2A_(), and operator LPCSTR().

◆ m_vAnsiArray

std::vector<char> textconv_helper::CW2A_::m_vAnsiArray
private

Referenced by CW2A_(), and operator LPCSTR().


The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/dev-utils/StackWalker.h