ReactOS 0.4.16-dev-122-g325d74c
WinDirectory Struct Reference

Windows file system directory-entry. More...

#include <winfs.h>

Inheritance diagram for WinDirectory:
Collaboration diagram for WinDirectory:

Public Member Functions

 WinDirectory (LPCTSTR root_path)
 
 WinDirectory (Entry *parent, LPCTSTR path)
 
 ~WinDirectory ()
 
virtual void read_directory (int scan_flags=0)
 
virtual const voidget_next_path_component (const void *) const
 
virtual Entryfind_entry (const void *)
 
- Public Member Functions inherited from WinEntry
 WinEntry (Entry *parent)
 
- Public Member Functions inherited from Entry
virtual ~Entry ()
 
void free_subentries ()
 
void read_directory_base (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
Entryread_tree (const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
void sort_directory (SORT_ORDER sortOrder)
 
void smart_scan (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
int extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
int safe_extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
virtual void read_directory (int scan_flags=0)
 
virtual const voidget_next_path_component (const void *) const
 
virtual Entryfind_entry (const void *)
 
virtual bool get_path (PTSTR path, size_t path_count) const =0
 
virtual ShellPath create_absolute_pidl () const
 
virtual HRESULT GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
 
virtual ShellFolder get_shell_folder () const
 
virtual BOOL launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
 
virtual HRESULT do_context_menu (HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs)
 

Additional Inherited Members

- Public Attributes inherited from Entry
Entry_next
 
Entry_down
 
Entry_up
 
bool _expanded
 
bool _scanned
 
int _level
 
WIN32_FIND_DATA _data
 
SFGAOF _shell_attribs
 
LPTSTR _display_name
 
LPTSTR _type_name
 
LPTSTR _content
 
ENTRY_TYPE _etype
 
int _icon_id
 
BY_HANDLE_FILE_INFORMATION _bhfi
 
bool _bhfi_valid
 
- Protected Member Functions inherited from WinEntry
 WinEntry ()
 
virtual bool get_path (PTSTR path, size_t path_count) const
 
virtual ShellPath create_absolute_pidl () const
 
- Protected Member Functions inherited from Entry
 Entry (ENTRY_TYPE etype)
 
 Entry (Entry *parent, ENTRY_TYPE etype)
 
 Entry (const Entry &)
 
bool get_path_base (PTSTR path, size_t path_count, ENTRY_TYPE etype) const
 
- Protected Member Functions inherited from Directory
 Directory ()
 
virtual ~Directory ()
 
- Protected Attributes inherited from Directory
void_path
 

Detailed Description

Windows file system directory-entry.

Definition at line 45 of file winfs.h.

Constructor & Destructor Documentation

◆ WinDirectory() [1/2]

WinDirectory::WinDirectory ( LPCTSTR  root_path)
inline

Definition at line 47 of file winfs.h.

48 : WinEntry()
49 {
50 _path = _tcsdup(root_path);
51 }
#define _tcsdup
Definition: tchar.h:625
void * _path
Definition: entries.h:143
WinEntry()
Definition: winfs.h:37

◆ WinDirectory() [2/2]

WinDirectory::WinDirectory ( Entry parent,
LPCTSTR  path 
)
inline

Definition at line 53 of file winfs.h.

55 {
57 }
r parent
Definition: btrfs.c:3010

◆ ~WinDirectory()

WinDirectory::~WinDirectory ( )
inline

Definition at line 59 of file winfs.h.

60 {
61 free(_path);
62 _path = NULL;
63 }
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112

Member Function Documentation

◆ find_entry()

Entry * WinDirectory::find_entry ( const void p)
virtual

Reimplemented from Entry.

Definition at line 212 of file winfs.cpp.

213{
215
216 for(Entry*entry=_down; entry; entry=entry->_next) {
217 LPCTSTR p = name;
218 LPCTSTR q = entry->_data.cFileName;
219
220 do {
221 if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
222 return entry;
223 } while(tolower(*p++) == tolower(*q++));
224
225 p = name;
226 q = entry->_data.cAlternateFileName;
227
228 do {
229 if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
230 return entry;
231 } while(tolower(*p++) == tolower(*q++));
232 }
233
234 return NULL;
235}
int tolower(int c)
Definition: utclib.c:902
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902
uint32_t entry
Definition: isohybrid.c:63
#define TEXT(s)
Definition: k32.h:26
base of all file and directory entries
Definition: entries.h:83
Entry * _down
Definition: entries.h:93
Definition: name.c:39
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

◆ get_next_path_component()

const void * WinDirectory::get_next_path_component ( const void p) const
virtual

Reimplemented from Entry.

Definition at line 195 of file winfs.cpp.

196{
197 LPCTSTR s = (LPCTSTR) p;
198
199 while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
200 ++s;
201
202 while(*s==TEXT('\\') || *s==TEXT('/'))
203 ++s;
204
205 if (!*s)
206 return NULL;
207
208 return s;
209}
GLdouble s
Definition: gl.h:2039

◆ read_directory()

void WinDirectory::read_directory ( int  scan_flags = 0)
virtual

Reimplemented from Entry.

Definition at line 123 of file winfs.cpp.

124{
125 CONTEXT("WinDirectory::read_directory()");
126
127 int level = _level + 1;
128
129 Entry* first_entry = NULL;
130 Entry* last = NULL;
131 Entry* entry;
132
135 for(pname=buffer; *path; )
136 *pname++ = *path++;
137
138 lstrcpy(pname, TEXT("\\*"));
139
140 WIN32_FIND_DATA w32fd;
141 HANDLE hFind = FindFirstFile(buffer, &w32fd);
142
143 if (hFind != INVALID_HANDLE_VALUE) {
144 do {
145 lstrcpy(pname+1, w32fd.cFileName);
146
147 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
148 entry = new WinDirectory(this, buffer);
149 else
150 entry = new WinEntry(this);
151
152 if (!first_entry)
153 first_entry = entry;
154
155 if (last)
156 last->_next = entry;
157
158 memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
159 entry->_level = level;
160
161 // display file type names, but don't hide file extensions
163
164 if (!(scan_flags & SCAN_DONT_ACCESS)) {
167
170 entry->_bhfi_valid = true;
171
172#ifdef BACKUP_READ_IMPLEMENTED
173 if (ScanNTFSStreams(entry, hFile))
174 entry->_scanned = true; // There exist named NTFS sub-streams in this file.
175#endif
176
178 }
179 }
180
181 last = entry; // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries.
182 } while(FindNextFile(hFind, &w32fd));
183
184 if (last)
185 last->_next = NULL;
186
187 FindClose(hFind);
188 }
189
190 _down = first_entry;
191 _scanned = true;
192}
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
Definition: fileinfo.c:458
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
@ SCAN_DONT_ACCESS
Definition: entries.h:54
GLint level
Definition: gl.h:1546
GLuint buffer
Definition: glext.h:5915
GLenum pname
Definition: glext.h:5645
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
static UINT UINT last
Definition: font.c:45
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
struct _CONTEXT CONTEXT
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
int _level
Definition: entries.h:98
bool _scanned
Definition: entries.h:97
FileTypeManager _ftype_mgr
Definition: globals.h:284
LPCTSTR set_type(struct Entry *entry, bool dont_hide_ext=false)
Definition: explorer.cpp:213
Windows file system directory-entry.
Definition: winfs.h:46
#define lstrcpy
Definition: winbase.h:3874
#define FindNextFile
Definition: winbase.h:3788
#define FindFirstFile
Definition: winbase.h:3782
#define CreateFile
Definition: winbase.h:3749
char TCHAR
Definition: xmlstorage.h:189

The documentation for this struct was generated from the following files: