mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
build: Refactor ImHexAPI into multiple separate files
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
#include <imgui.h>
|
||||
#include <implot.h>
|
||||
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <hex/providers/buffered_reader.hpp>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/ui/popup.hpp>
|
||||
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/ui/view.hpp>
|
||||
#include <hex/api/imhex_api/bookmarks.hpp>
|
||||
|
||||
#include <ui/text_editor.hpp>
|
||||
|
||||
@@ -36,4 +37,4 @@ namespace hex::plugin::builtin {
|
||||
PerProvider<u64> m_currBookmarkId;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include <vector>
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include <content/command_line_interface.hpp>
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/events/requests_interaction.hpp>
|
||||
#include <hex/api/events/requests_gui.hpp>
|
||||
#include <hex/api/plugin_manager.hpp>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/shortcut_manager.hpp>
|
||||
|
||||
#include <hex/ui/view.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/events/requests_interaction.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <hex/data_processor/node.hpp>
|
||||
|
||||
#include <wolv/utils/core.hpp>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <algorithm>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/helpers/crypto.hpp>
|
||||
#include <hex/data_processor/node.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/achievement_manager.hpp>
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include <imgui_internal.h>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/data_processor/node.hpp>
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
class NodeDisplayInteger : public dp::Node {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <content/differing_byte_searcher.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/events/events_gui.hpp>
|
||||
#include <hex/api_urls.hpp>
|
||||
@@ -14,9 +14,7 @@
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace hex::fonts { bool setupFonts(); }
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
@@ -9,17 +10,17 @@
|
||||
#include <hex/api/layout_manager.hpp>
|
||||
#include <hex/api/achievement_manager.hpp>
|
||||
#include <hex/api/events/requests_gui.hpp>
|
||||
#include <hex/api/tutorial_manager.hpp>
|
||||
#include <hex/api/workspace_manager.hpp>
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include <hex/helpers/crypto.hpp>
|
||||
#include <hex/helpers/patches.hpp>
|
||||
#include <hex/helpers/debugging.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
#include <content/global_actions.hpp>
|
||||
#include <toasts/toast_notification.hpp>
|
||||
#include <popups/popup_text_input.hpp>
|
||||
#include <hex/api/workspace_manager.hpp>
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
|
||||
#include <wolv/io/file.hpp>
|
||||
#include <wolv/literals.hpp>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/events/events_lifecycle.hpp>
|
||||
#include <hex/api/events/events_gui.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/api/theme_manager.hpp>
|
||||
#include <hex/api/tutorial_manager.hpp>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/auto_reset.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <romfs/romfs.hpp>
|
||||
#include <wolv/hash/uuid.hpp>
|
||||
#include <wolv/utils/guards.hpp>
|
||||
|
||||
#include <list>
|
||||
#include <numbers>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/helpers/encoding_file.hpp>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <hex/helpers/magic.hpp>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <pl/core/evaluator.hpp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <wolv/utils/guards.hpp>
|
||||
#include <wolv/utils/string.hpp>
|
||||
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/project_file_manager.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/achievement_manager.hpp>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <hex/helpers/logger.hpp>
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <wolv/utils/string.hpp>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "content/providers/memory_file_provider.hpp"
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/project_file_manager.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
#include <hex/api/events/requests_provider.hpp>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#if defined(OS_WINDOWS) || defined(OS_MACOS) || (defined(OS_LINUX) && !defined(OS_FREEBSD))
|
||||
|
||||
#include <content/providers/process_memory_provider.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
|
||||
#if defined(OS_WINDOWS)
|
||||
#include <windows.h>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
#include <hex/api/events/requests_gui.hpp>
|
||||
#include <popups/popup_text_input.hpp>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
#include <hex/api/events/events_lifecycle.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/api/project_file_manager.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/theme_manager.hpp>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/trace/stacktrace.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <ui/text_editor.hpp>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <hex/helpers/http_requests.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <hex/helpers/http_requests.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
|
||||
#include <hex/providers/memory_provider.hpp>
|
||||
#include <hex/helpers/scaling.hpp>
|
||||
|
||||
#include <wolv/net/socket_client.hpp>
|
||||
#include <wolv/net/socket_server.hpp>
|
||||
|
||||
@@ -7,8 +11,6 @@
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/providers/memory_provider.hpp>
|
||||
|
||||
#include <jthread.hpp>
|
||||
#include <string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/imhex_api/system.hpp>
|
||||
#include <hex/api/localization_manager.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
#include <hex/helpers/logger.hpp>
|
||||
#include <hex/helpers/debugging.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <imgui.h>
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
#include <content/views/fullscreen/view_fullscreen_save_editor.hpp>
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <toasts/toast_notification.hpp>
|
||||
#include <popups/popup_question.hpp>
|
||||
|
||||
#include <wolv/utils/lock.hpp>
|
||||
#include <pl/patterns/pattern.hpp>
|
||||
#include <popups/popup_question.hpp>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include "imstb_textedit.h"
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <ui/pattern_drawer.hpp>
|
||||
#include <ui/visualizer_drawer.hpp>
|
||||
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <pl/pattern_language.hpp>
|
||||
#include <pl/patterns/pattern.hpp>
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#include "content/views/view_find.hpp"
|
||||
|
||||
#include <hex/api/imhex_api.hpp>
|
||||
#include <hex/api/achievement_manager.hpp>
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
#include <hex/trace/stacktrace.hpp>
|
||||
|
||||
#include <hex/providers/buffered_reader.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <array>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <wolv/utils/guards.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <hex/api/events/events_interaction.hpp>
|
||||
|
||||
#include <fonts/vscode_icons.hpp>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
#include <pl/patterns/pattern.hpp>
|
||||
#include <wolv/utils/lock.hpp>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "content/views/view_provider_settings.hpp"
|
||||
|
||||
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/api/events/events_provider.hpp>
|
||||
#include <hex/providers/provider.hpp>
|
||||
|
||||
#include <toasts/toast_notification.hpp>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/helpers/logger.hpp>
|
||||
#include <hex/helpers/debugging.hpp>
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
#include <romfs/romfs.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <hex/api/plugin_manager.hpp>
|
||||
#include <content/views/view_patches.hpp>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/api/imhex_api/provider.hpp>
|
||||
|
||||
using namespace hex;
|
||||
using namespace hex::plugin::builtin;
|
||||
@@ -10,22 +11,22 @@ using namespace hex::plugin::builtin;
|
||||
TEST_SEQUENCE("Providers/ReadWrite") {
|
||||
INIT_PLUGIN("Built-in");
|
||||
|
||||
auto &pr = *ImHexApi::Provider::createProvider("hex.builtin.provider.mem_file", true);
|
||||
auto &provider = *ImHexApi::Provider::createProvider("hex.builtin.provider.mem_file", true);
|
||||
|
||||
TEST_ASSERT(pr.getSize() == 0);
|
||||
TEST_ASSERT(!pr.isDirty());
|
||||
TEST_ASSERT(provider.getSize() == 0);
|
||||
TEST_ASSERT(!provider.isDirty());
|
||||
|
||||
pr.resize(50);
|
||||
TEST_ASSERT(pr.getSize() == 50);
|
||||
TEST_ASSERT(pr.isDirty());
|
||||
provider.resize(50);
|
||||
TEST_ASSERT(provider.getSize() == 50);
|
||||
TEST_ASSERT(provider.isDirty());
|
||||
|
||||
char buf[] = "\x99\x99"; // temporary value that should be overwriten
|
||||
pr.read(0, buf, 2);
|
||||
provider.read(0, buf, 2);
|
||||
TEST_ASSERT(std::equal(buf, buf+2, "\x00\x00"));
|
||||
|
||||
pr.write(0, "\xFF\xFF", 2);
|
||||
provider.write(0, "\xFF\xFF", 2);
|
||||
char buf2[] = "\x99\x99"; // temporary value that should be overwriten
|
||||
pr.read(0, buf2, 2);
|
||||
provider.read(0, buf2, 2);
|
||||
TEST_ASSERT(std::equal(buf2, buf2+2, "\xFF\xFF"));
|
||||
|
||||
TEST_SUCCESS();
|
||||
|
||||
Reference in New Issue
Block a user