PowerToys/src/modules/powerrename/lib/MRUListHandler.h
Stefan Markovic 5cfbd72fa8
[PowerRename] Fluent UX (#13678)
* PowerRename new UI

* Add scrollviewer

* Don't deploy PowerRenameUI_new

* Visual updates

* Visual updates

* Updates

* Update Resources.resw

* Added docs button

* Update MainWindow.xaml

* Wire Docs button

* RegEx -> regular expressions

* Update Show only renamed list on search/replace text changed

* Update Show only renamed list on search/replace text changed - proper fix
Set searchTerm to NULL when cleared - fix Show only renamed files on clear searchTerm

* Files/folders input error handling

* Fix renaming with keeping UI window opened

After renaming folder, all of it's children need path update.
Without path update, further renaming of children items would
fail.

* Update only children, not all items with greater depth

* Fix dictionary false positives

* Remove .NET dep

* Rename PowerRenameUI_new to PowerRenameUILib
Rename executable PowerRenameUIHost to PowerRename

Co-authored-by: Laute <Niels.Laute@philips.com>
2021-10-25 14:40:19 +01:00

36 lines
747 B
C++

#pragma once
#include "pch.h"
#include <filesystem>
#include <string>
#include <common/utils/json.h>
class MRUListHandler
{
public:
MRUListHandler(unsigned int size, const std::wstring& filePath, const std::wstring& regPath);
void Push(const std::wstring& data);
bool Next(std::wstring& data);
void Reset();
const std::vector<std::wstring>& GetItems();
private:
void Load();
void Save();
void MigrateFromRegistry();
json::JsonArray Serialize();
void ParseJson();
bool Exists(const std::wstring& data);
std::vector<std::wstring> items;
unsigned int pushIdx;
unsigned int nextIdx;
unsigned int size;
const std::wstring jsonFilePath;
const std::wstring registryFilePath;
};