mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-31 15:28:21 -04:00
Merge Qt/non-Qt codebase
- added UEFIDump tool, which is now Windows-only UEFIExtract with some limitations, made as PoC for non-Qt engine usage - ensured that Qt classes will be used, if available - checked build of UT and UE - porting of UEFIFind to non-Qt engine TBD
This commit is contained in:
parent
12029c768c
commit
9045fc6cc0
22 changed files with 612 additions and 250 deletions
|
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#ifndef UBYTEARRAY_H
|
||||
#define UBYTEARRAY_H
|
||||
|
||||
#if defined(QT_CORE_LIB) && defined(U_USE_QBYTEARRAY)
|
||||
#if defined(QT_CORE_LIB)
|
||||
// Use Qt class, if Qt is available
|
||||
#include <QByteArray>
|
||||
#define UByteArray QByteArray
|
||||
|
@ -60,14 +60,14 @@ public:
|
|||
bool operator!= (const UByteArray & ba) const { return d != ba.d; }
|
||||
inline void swap(UByteArray &other) { std::swap(d, other.d); }
|
||||
UByteArray toHex() {
|
||||
std::basic_string<char> hex(size() * 2, '\x00');
|
||||
for (int32_t i = 0; i < size(); ++i) {
|
||||
std::basic_string<char> hex(size() * 2, '\x00');
|
||||
for (int32_t i = 0; i < size(); i++) {
|
||||
uint8_t low = d[i] & 0x0F;
|
||||
uint8_t high = (d[i] & 0xF0) >> 4;
|
||||
low += (low < 10 ? 'a' : '0');
|
||||
high += (high < 10 ? 'a' : '0');
|
||||
hex[i] = low;
|
||||
hex[i + 1] = high;
|
||||
low += (low < 10 ? '0' : 'a');
|
||||
high += (high < 10 ? '0' : 'a');
|
||||
hex[2*i] = low;
|
||||
hex[2*i + 1] = high;
|
||||
}
|
||||
std::reverse(hex.begin(), hex.end());
|
||||
return UByteArray(hex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue