ReactOS  0.4.15-dev-1070-ge1a01de
CCompletionMatch Class Reference
Collaboration diagram for CCompletionMatch:

Public Member Functions

 CCompletionMatch ()
 
BOOL Init (const TCHAR *pszText)
 
 ~CCompletionMatch ()
 

Private Attributes

TCHARm_pszText
 
BOOL m_blnIsKey
 
CCompletionMatchm_pNext
 
CCompletionMatchm_pPrev
 

Friends

class CCompletionList
 

Detailed Description

Definition at line 33 of file Completion.cpp.

Constructor & Destructor Documentation

◆ CCompletionMatch()

CCompletionMatch::CCompletionMatch ( )
inline

Definition at line 36 of file Completion.cpp.

37  {
38  m_pNext = m_pPrev = NULL;
39  m_pszText = NULL;
40  };
CCompletionMatch * m_pNext
Definition: Completion.cpp:83
smooth NULL
Definition: ftsmooth.c:416
CCompletionMatch * m_pPrev
Definition: Completion.cpp:84

◆ ~CCompletionMatch()

CCompletionMatch::~CCompletionMatch ( )
inline

Definition at line 74 of file Completion.cpp.

75  {
76  if (m_pszText)
77  delete[] m_pszText;
78  }

Member Function Documentation

◆ Init()

BOOL CCompletionMatch::Init ( const TCHAR pszText)
inline

Definition at line 42 of file Completion.cpp.

43  {
44  // find the offset to "unique" part
45  const TCHAR *pszUnique = _tcsrchr(pszText,_T('\\'));
46  pszUnique = pszUnique?(pszUnique+1):pszText;
47  BOOL b = _tcschr(pszUnique,_T(' ')) != NULL; // has it spaces in it ???
48  size_t s = _tcslen(pszText);
49 
50  if (m_pszText)
51  delete[] m_pszText;
52 
53  m_pszText = new (std::nothrow) TCHAR [s+(b?3:1)]; // if we have spaces in unique part, we need 2 addtional chars for "
54 
55  if (!m_pszText)
56  return FALSE;
57 
58  ASSERT(pszText <= pszUnique);
59  s = pszUnique - pszText; // calculate offset of the unique part
60  if (s)
61  _tcsncpy(m_pszText,pszText,s);
62 
63  if (b)
64  m_pszText[s++] = _T('\"');
65 
66  _tcscpy(m_pszText+s,pszUnique);
67 
68  if (b)
69  _tcscat(m_pszText,_T("\""));
70 
71  return TRUE;
72  }
#define TRUE
Definition: types.h:120
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
smooth NULL
Definition: ftsmooth.c:416
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
Definition: tcschr.h:4
char TCHAR
Definition: xmlstorage.h:189
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define _T(x)
Definition: vfdio.h:22
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
GLdouble s
Definition: gl.h:2039
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4

Referenced by CCompletionList::Add().

Friends And Related Function Documentation

◆ CCompletionList

friend class CCompletionList
friend

Definition at line 85 of file Completion.cpp.

Member Data Documentation

◆ m_blnIsKey

BOOL CCompletionMatch::m_blnIsKey
private

Definition at line 82 of file Completion.cpp.

Referenced by CCompletionList::Add(), and CCompletionList::Get().

◆ m_pNext

CCompletionMatch* CCompletionMatch::m_pNext
private

◆ m_pPrev

CCompletionMatch* CCompletionMatch::m_pPrev
private

Definition at line 84 of file Completion.cpp.

Referenced by CCompletionList::Add(), CCompletionMatch(), and CCompletionList::Get().

◆ m_pszText

TCHAR* CCompletionMatch::m_pszText
private

The documentation for this class was generated from the following file: