ReactOS  0.4.13-dev-961-g238ea69
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 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

Referenced by read_directory().

◆ WinDirectory() [2/2]

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

Definition at line 53 of file winfs.h.

54  : WinEntry(parent)
55  {
56  _path = _tcsdup(path);
57  }
#define _tcsdup
Definition: tchar.h:625
r parent
Definition: btrfs.c:2708
void * _path
Definition: entries.h:143
Definition: services.c:325
WinEntry()
Definition: winfs.h:37

◆ ~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
smooth NULL
Definition: ftsmooth.c:416
void * _path
Definition: entries.h:143

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 {
214  LPCTSTR name = (LPCTSTR)p;
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 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
smooth NULL
Definition: ftsmooth.c:416
Entry * _down
Definition: entries.h:93
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
uint32_t entry
Definition: isohybrid.c:63
#define TEXT(s)
Definition: k32.h:26
Definition: name.c:36
GLfloat GLfloat p
Definition: glext.h:8902
int tolower(int c)
Definition: utclib.c:902
base of all file and directory entries
Definition: entries.h:82
GLuint const GLchar * name
Definition: glext.h:6031

◆ 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 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
smooth NULL
Definition: ftsmooth.c:416
GLdouble s
Definition: gl.h:2039
#define TEXT(s)
Definition: k32.h:26
GLfloat GLfloat p
Definition: glext.h:8902

◆ 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 
168  if (hFile != INVALID_HANDLE_VALUE) {
169  if (GetFileInformationByHandle(hFile, &entry->_bhfi))
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 }
GLint level
Definition: gl.h:1546
struct _CONTEXT CONTEXT
WinDirectory(LPCTSTR root_path)
Definition: winfs.h:47
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define CloseHandle
Definition: compat.h:398
FileTypeManager _ftype_mgr
Definition: globals.h:284
POINT last
Definition: font.c:46
GLsizei const GLchar ** path
Definition: glext.h:7234
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
GLuint buffer
Definition: glext.h:5915
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
GLenum pname
Definition: glext.h:5645
smooth NULL
Definition: ftsmooth.c:416
#define FindFirstFile
Definition: winbase.h:3596
#define OPEN_EXISTING
Definition: compat.h:426
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
char TCHAR
Definition: xmlstorage.h:189
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
Definition: fileinfo.c:608
#define FindNextFile
Definition: winbase.h:3602
Entry * _down
Definition: entries.h:93
LPCTSTR set_type(struct Entry *entry, bool dont_hide_ext=false)
Definition: explorer.cpp:213
#define MAX_PATH
Definition: compat.h:26
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
int _level
Definition: entries.h:98
#define TEXT(s)
Definition: k32.h:26
void * _path
Definition: entries.h:143
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904
#define lstrcpy
Definition: winbase.h:3688
Definition: services.c:325
bool _scanned
Definition: entries.h:97
#define FILE_FLAG_BACKUP_SEMANTICS
Definition: disk.h:41
WinEntry()
Definition: winfs.h:37
base of all file and directory entries
Definition: entries.h:82
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502

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