ReactOS 0.4.15-dev-8119-g4fb2fdb
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 {
40 };
CCompletionMatch * m_pNext
Definition: Completion.cpp:83
CCompletionMatch * m_pPrev
Definition: Completion.cpp:84
#define NULL
Definition: types.h:112

◆ ~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
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLdouble s
Definition: gl.h:2039
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define _tcscat
Definition: tchar.h:622
#define _tcscpy
Definition: tchar.h:623
#define _tcsncpy
Definition: tchar.h:1410
#define _tcschr
Definition: tchar.h:1406
#define ASSERT(a)
Definition: mode.c:44
#define _tcsrchr
Definition: utility.h:116
#define _T(x)
Definition: vfdio.h:22
char TCHAR
Definition: xmlstorage.h:189
#define _tcslen
Definition: xmlstorage.h:198

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: