2020-11-10 23:13:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-05-30 14:36:46 +00:00
|
|
|
#include <hex/api/content_registry.hpp>
|
|
|
|
|
2022-02-01 17:09:40 +00:00
|
|
|
#include <hex/ui/view.hpp>
|
2020-11-10 23:13:09 +00:00
|
|
|
|
2021-10-26 15:21:48 +00:00
|
|
|
#include <array>
|
|
|
|
#include <utility>
|
2020-11-10 23:13:09 +00:00
|
|
|
#include <cstdio>
|
|
|
|
|
2021-12-07 21:47:41 +00:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-10 23:13:09 +00:00
|
|
|
|
|
|
|
class ViewHashes : public View {
|
|
|
|
public:
|
2020-12-27 14:39:06 +00:00
|
|
|
explicit ViewHashes();
|
2020-11-11 08:28:44 +00:00
|
|
|
~ViewHashes() override;
|
2020-11-10 23:13:09 +00:00
|
|
|
|
2020-12-22 17:10:01 +00:00
|
|
|
void drawContent() override;
|
2020-11-10 23:13:09 +00:00
|
|
|
|
2023-01-18 13:30:56 +00:00
|
|
|
private:
|
2023-04-17 14:18:48 +00:00
|
|
|
bool importHashes(prv::Provider *provider, const nlohmann::json &json);
|
|
|
|
bool exportHashes(prv::Provider *provider, nlohmann::json &json);
|
2023-01-18 13:30:56 +00:00
|
|
|
|
2020-11-10 23:13:09 +00:00
|
|
|
private:
|
2022-05-30 14:36:46 +00:00
|
|
|
ContentRegistry::Hashes::Hash *m_selectedHash = nullptr;
|
|
|
|
std::string m_newHashName;
|
2023-04-17 14:18:48 +00:00
|
|
|
|
|
|
|
PerProvider<std::vector<ContentRegistry::Hashes::Hash::Function>> m_hashFunctions;
|
|
|
|
|
2020-11-10 23:13:09 +00:00
|
|
|
};
|
|
|
|
|
2021-10-26 15:21:48 +00:00
|
|
|
}
|