[PowerRename] Using File Date Time Attributes Feature (#4722)

* Add basic using file attributes functionality

* Correctly return result

* Refactor

* Move retrieving date attribute to get function

* Cover various milliseconds patterns, retrieve file attributes only when needed

* Correctly check if date/time pattern is used. Remove wstring cast

* Use correct flags on CreateFile call to handle directories

* rebase to master

* Perform transform operation at last to make it not mess with date/time variables

* Refactor, remove extra space
This commit is contained in:
Mehmet Murat Akburak
2020-07-16 14:24:49 +03:00
committed by GitHub
parent ebe70a52d1
commit a8153dd8db
6 changed files with 135 additions and 14 deletions

View File

@@ -15,6 +15,7 @@ public:
// IPowerRenameItem
IFACEMETHODIMP get_path(_Outptr_ PWSTR* path);
IFACEMETHODIMP get_date(_Outptr_ SYSTEMTIME* date);
IFACEMETHODIMP get_shellItem(_Outptr_ IShellItem** ppsi);
IFACEMETHODIMP get_originalName(_Outptr_ PWSTR* originalName);
IFACEMETHODIMP put_newName(_In_opt_ PCWSTR newName);
@@ -46,15 +47,17 @@ protected:
HRESULT _Init(_In_ IShellItem* psi);
bool m_selected = true;
bool m_isFolder = false;
int m_id = -1;
int m_iconIndex = -1;
UINT m_depth = 0;
HRESULT m_error = S_OK;
PWSTR m_path = nullptr;
PWSTR m_originalName = nullptr;
PWSTR m_newName = nullptr;
CSRWLock m_lock;
long m_refCount = 0;
};
bool m_selected = true;
bool m_isFolder = false;
bool m_isDateParsed = false;
int m_id = -1;
int m_iconIndex = -1;
UINT m_depth = 0;
HRESULT m_error = S_OK;
PWSTR m_path = nullptr;
PWSTR m_originalName = nullptr;
PWSTR m_newName = nullptr;
SYSTEMTIME m_date;
CSRWLock m_lock;
long m_refCount = 0;
};