mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-01-26 22:49:21 -06:00
sys: Updated more code to libwolv
This commit is contained in:
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
Submodule lib/external/libwolv updated: f98c18807a...3c3843db13
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 0858a0a1a0...f7b6ca47ef
@@ -47,8 +47,7 @@ if (APPLE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES}
|
||||
source/helpers/utils_macos.m)
|
||||
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES} source/helpers/utils_macos.m)
|
||||
endif ()
|
||||
|
||||
add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(OS_MACOS)
|
||||
|
||||
#include <hex/helpers/fs.hpp>
|
||||
|
||||
extern "C" char * getMacExecutableDirectoryPath();
|
||||
extern "C" char * getMacApplicationSupportDirectoryPath();
|
||||
|
||||
extern "C" void macFree(void *ptr);
|
||||
|
||||
#endif
|
||||
@@ -238,26 +238,6 @@ namespace hex {
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void trimLeft(std::basic_string<T> &s) {
|
||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
|
||||
return !std::isspace(ch) && ch >= 0x20;
|
||||
}));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void trimRight(std::basic_string<T> &s) {
|
||||
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
|
||||
return !std::isspace(ch) && ch >= 0x20;
|
||||
}).base(), s.end());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void trim(std::basic_string<T> &s) {
|
||||
trimLeft(s);
|
||||
trimRight(s);
|
||||
}
|
||||
|
||||
float float16ToFloat32(u16 float16);
|
||||
|
||||
inline bool equalsIgnoreCase(const std::string &left, const std::string &right) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include <hex/helpers/encoding_file.hpp>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
|
||||
#include <wolv/io/file.hpp>
|
||||
#include <wolv/utils/string.hpp>
|
||||
|
||||
namespace hex {
|
||||
|
||||
@@ -52,7 +54,7 @@ namespace hex {
|
||||
if (fromBytes.empty()) continue;
|
||||
|
||||
if (to.length() > 1)
|
||||
hex::trim(to);
|
||||
to = wolv::util::trim(to);
|
||||
if (to.empty())
|
||||
to = " ";
|
||||
|
||||
|
||||
@@ -316,8 +316,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
if (drawDefaultTextEditingTextBox(address, this->m_inputBuffer, ImGuiInputTextFlags_None)) {
|
||||
hex::trim(this->m_inputBuffer);
|
||||
if (auto result = hex::parseBinaryString(this->m_inputBuffer); result.has_value()) {
|
||||
if (auto result = hex::parseBinaryString(wolv::util::trim(this->m_inputBuffer)); result.has_value()) {
|
||||
*data = result.value();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,9 +294,8 @@ namespace hex::plugin::builtin {
|
||||
if (yr_compiler_add_file(compiler, file.getHandle(), nullptr, nullptr) != 0) {
|
||||
std::string errorMessage(0xFFFF, '\x00');
|
||||
yr_compiler_get_error_message(compiler, errorMessage.data(), errorMessage.size());
|
||||
hex::trim(errorMessage);
|
||||
|
||||
TaskManager::doLater([this, errorMessage] {
|
||||
TaskManager::doLater([this, errorMessage = wolv::util::trim(errorMessage)] {
|
||||
this->clearResult();
|
||||
|
||||
this->m_consoleMessages.push_back("Error: " + errorMessage);
|
||||
|
||||
Reference in New Issue
Block a user