#include <RemotePidlManager.h>
Public Member Functions | |
HRESULT | Create (LPCWSTR pwszPath, LPCWSTR pwszOwner, LPCWSTR pwszGroup, DWORD dwPermissions, ULONGLONG uSize, time_t dtModified, BOOL fIsFolder, PITEMID_CHILD *ppidlOut) |
Create a new terminated PIDL using the passed-in file information. | |
PREMOTEPIDL | Validate (PCIDLIST_RELATIVE) |
Validate that pidl is a REMOTEPIDL and return correctly typecast. | |
HRESULT | IsValid (PCIDLIST_RELATIVE) |
Check if the fingerprint stored in the PIDL corresponds to a REMOTEPIDL. | |
CString | GetPath (LPCITEMIDLIST pidl) |
Get the path of the file from a (possibly multilevel) PIDL. | |
CString | GetOwner (LPCITEMIDLIST pidl) |
Get the name of the file's owner from a (possibly multilevel) PIDL. | |
CString | GetGroup (LPCITEMIDLIST pidl) |
Get the name of the file's group name from a (possibly multilevel) PIDL. | |
DWORD | GetPermissions (LPCITEMIDLIST pidl) |
Get the Unix file permissions from a (possibly multilevel) PIDL. | |
CString | GetPermissionsStr (LPCITEMIDLIST pidl) |
Get the Unix file permissions in typical drwxrwxrwx form from a PIDL. | |
ULONGLONG | GetFileSize (LPCITEMIDLIST pidl) |
Get the file's size from a (possibly multilevel) PIDL. | |
CTime | GetLastModified (LPCITEMIDLIST pidl) |
Get the time and date that the file was last changed from a PIDL. | |
BOOL | IsFolder (LPCITEMIDLIST pidl) |
Determine if the file represented by the PIDL is actually a folder. | |
Private Member Functions | |
PREMOTEPIDL | GetDataSegment (LPCITEMIDLIST pidl) |
Walk to last item in PIDL (if multilevel) and return item as a REMOTEPIDL. |
Definition at line 51 of file RemotePidlManager.h.
HRESULT CRemotePidlManager::Create | ( | LPCWSTR | pwszPath, | |
LPCWSTR | pwszOwner, | |||
LPCWSTR | pwszGroup, | |||
DWORD | dwPermissions, | |||
ULONGLONG | uSize, | |||
time_t | dtModified, | |||
BOOL | fIsFolder, | |||
PITEMID_CHILD * | ppidlOut | |||
) |
Create a new terminated PIDL using the passed-in file information.
[in] | pwszPath | Path of the file on the remote file-system |
[in] | pwszOwner | Name of the file owner on the remote system |
[in] | pwszGroup | Name of the file group on the remote system |
[in] | dwPermissions | Value of the file's Unix permissions bits |
[in] | uSize | Size of the file in bytes |
[in] | dtModified | Date that the file was last modified as a Unix timestamp |
[in] | fIsFolder | Indicates if the file is folder |
[out] | ppidlOut | Location that the resultant PIDL should be stored at |
S_OK | if PIDL successful created at location ppidlOut | |
E_OUTOFMEMORY | otherwise |
Definition at line 41 of file RemotePidlManager.cpp.
References REMOTEPIDL::cb, CPidlManager::CopyWSZString(), CPidlManager::GetNextItem(), IsValid(), and REMOTEPIDL_FINGERPRINT.
Referenced by CRemoteEnumIDList::Next().
PREMOTEPIDL CRemotePidlManager::Validate | ( | PCIDLIST_RELATIVE | pidl | ) |
Validate that pidl is a REMOTEPIDL and return correctly typecast.
pidl | PIDL to be validated |
pidl | as a REMOTEPIDL if fingerprint matches REMOTEPIDL_FINGERPRINT | |
NULL | otherwise or if the function is being used as a simple boolean check | |
true | if fingerprint matches REMOTEPIDL_FINGERPRINT | |
false | otherwise |
Validate() checks that pidl is a REMOTEPIDL by comparing its stored fingerprint with that which it should have given when created. If validation succeeds, pidl is returned appropriately typecast giving easy access to fields of REMOTEPIDL.
ATLASSERT(Validate(pidl));
Definition at line 114 of file RemotePidlManager.cpp.
References REMOTEPIDL_FINGERPRINT.
Referenced by GetDataSegment(), and IsValid().
HRESULT CRemotePidlManager::IsValid | ( | PCIDLIST_RELATIVE | pidl | ) |
Check if the fingerprint stored in the PIDL corresponds to a REMOTEPIDL.
pidl | PIDL to be validated |
S_OK | if pidl is of type REMOTEPIDL | |
E_INVALIDARG | otherwise |
Definition at line 143 of file RemotePidlManager.cpp.
References Validate().
Referenced by Create(), and GetDataSegment().
CString CRemotePidlManager::GetPath | ( | LPCITEMIDLIST | pidl | ) |
Get the path of the file from a (possibly multilevel) PIDL.
pidl | The PIDL from which to retrieve the path |
CString
or an empty CString
if the last item of pidl was not a valid REMOTEPIDL.Definition at line 160 of file RemotePidlManager.cpp.
References GetDataSegment().
CString CRemotePidlManager::GetOwner | ( | LPCITEMIDLIST | pidl | ) |
Get the name of the file's owner from a (possibly multilevel) PIDL.
pidl | The PIDL from which to retrieve the name |
CString
or an empty CString
if the last item of pidl was not a valid REMOTEPIDL.Definition at line 178 of file RemotePidlManager.cpp.
References GetDataSegment().
CString CRemotePidlManager::GetGroup | ( | LPCITEMIDLIST | pidl | ) |
Get the name of the file's group name from a (possibly multilevel) PIDL.
pidl | The PIDL from which to retrieve the name |
CString
or an empty CString
if the last item of pidl was not a valid REMOTEPIDL.Definition at line 196 of file RemotePidlManager.cpp.
References GetDataSegment().
DWORD CRemotePidlManager::GetPermissions | ( | LPCITEMIDLIST | pidl | ) |
Get the Unix file permissions from a (possibly multilevel) PIDL.
pidl | The PIDL from which to retrieve the permissions |
Definition at line 214 of file RemotePidlManager.cpp.
References GetDataSegment().
CString CRemotePidlManager::GetPermissionsStr | ( | LPCITEMIDLIST | pidl | ) |
Get the Unix file permissions in typical drwxrwxrwx
form from a PIDL.
pidl | The PIDL from which to retrieve the permissions |
CString
in drwxrwxrwx
form or an empty CString
if the last item of pidl was not a valid REMOTEPIDL.Definition at line 236 of file RemotePidlManager.cpp.
ULONGLONG CRemotePidlManager::GetFileSize | ( | LPCITEMIDLIST | pidl | ) |
Get the file's size from a (possibly multilevel) PIDL.
pidl | The PIDL from which to retrieve the size |
Definition at line 255 of file RemotePidlManager.cpp.
References GetDataSegment().
CTime CRemotePidlManager::GetLastModified | ( | LPCITEMIDLIST | pidl | ) |
Get the time and date that the file was last changed from a PIDL.
pidl | The PIDL from which to retrieve the date |
CTime
or 0 if the last item of pidl was not a valid REMOTEPIDL.Definition at line 273 of file RemotePidlManager.cpp.
References GetDataSegment().
BOOL CRemotePidlManager::IsFolder | ( | LPCITEMIDLIST | pidl | ) |
Determine if the file represented by the PIDL is actually a folder.
pidl | The PIDL to be checked |
TRUE
if the PIDL represents a folder (directory) rather than a file or other filesystem object and FALSE
otherwise.Definition at line 291 of file RemotePidlManager.cpp.
References GetDataSegment().
PREMOTEPIDL CRemotePidlManager::GetDataSegment | ( | LPCITEMIDLIST | pidl | ) | [private] |
Walk to last item in PIDL (if multilevel) and return item as a REMOTEPIDL.
pidl | The PIDL to retrieve the last REMOTEPIDL data segment from |
NULL
otherwise.Reimplemented from CPidlManager.
Definition at line 309 of file RemotePidlManager.cpp.
References CPidlManager::GetDataSegment(), IsValid(), and Validate().
Referenced by GetFileSize(), GetGroup(), GetLastModified(), GetOwner(), GetPath(), GetPermissions(), and IsFolder().