ReactOS 0.4.15-dev-7918-g2a2556c
CDirectoryList.h
Go to the documentation of this file.
1#pragma once
2
3#include <atlsimpcoll.h> // for CSimpleArray
4
6
7// A pathname with info
9{
10public:
12 {
13 }
14
16 {
17 m_pszPath = _wcsdup(pszPath);
18 }
19
22 {
23 }
24
26 {
27 if (this != &item)
28 {
30 m_pszPath = _wcsdup(item.m_pszPath);
31 }
32 return *this;
33 }
34
36 {
38 }
39
40 BOOL IsEmpty() const
41 {
42 return m_pszPath == NULL;
43 }
44
46 {
47 return m_pszPath;
48 }
49
50 void SetPath(LPCWSTR pszPath)
51 {
53 m_pszPath = _wcsdup(pszPath);
54 }
55
56 BOOL EqualPath(LPCWSTR pszPath) const
57 {
58 return m_pszPath != NULL && lstrcmpiW(m_pszPath, pszPath) == 0;
59 }
60
61protected:
62 LPWSTR m_pszPath; // A full path, malloc'ed
63};
64
65// the directory list
67{
68public:
70 {
71 }
72
73 CDirectoryList(LPCWSTR pszDirectoryPath, BOOL fRecursive)
74 : m_fRecursive(fRecursive)
75 {
76 AddPathsFromDirectory(pszDirectoryPath);
77 }
78
79 BOOL ContainsPath(LPCWSTR pszPath) const;
80 BOOL AddPath(LPCWSTR pszPath);
81 BOOL AddPathsFromDirectory(LPCWSTR pszDirectoryPath);
82 BOOL RenamePath(LPCWSTR pszPath1, LPCWSTR pszPath2);
83 BOOL DeletePath(LPCWSTR pszPath);
84
85 void RemoveAll()
86 {
87 m_items.RemoveAll();
88 }
89
90protected:
93};
CDirectoryItem & operator=(const CDirectoryItem &item)
BOOL IsEmpty() const
CDirectoryItem(const CDirectoryItem &item)
void SetPath(LPCWSTR pszPath)
CDirectoryItem(LPCWSTR pszPath)
LPCWSTR GetPath() const
BOOL EqualPath(LPCWSTR pszPath) const
BOOL AddPath(LPCWSTR pszPath)
BOOL ContainsPath(LPCWSTR pszPath) const
CSimpleArray< CDirectoryItem > m_items
BOOL DeletePath(LPCWSTR pszPath)
BOOL AddPathsFromDirectory(LPCWSTR pszDirectoryPath)
BOOL RenamePath(LPCWSTR pszPath1, LPCWSTR pszPath2)
CDirectoryList(LPCWSTR pszDirectoryPath, BOOL fRecursive)
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static ATOM item
Definition: dde.c:856
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185