mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
build: Updated libfmt (#2234)
This commit is contained in:
@@ -621,11 +621,11 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.time32", sizeof(u32), [](auto buffer, auto endian, auto style) {
|
||||
std::ignore = style;
|
||||
|
||||
auto endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<u32 *>(buffer.data()), endian);
|
||||
time_t endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<u32 *>(buffer.data()), endian);
|
||||
|
||||
std::string value;
|
||||
try {
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", fmt::localtime(endianAdjustedTime));
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", *std::localtime(&endianAdjustedTime));
|
||||
} catch (fmt::format_error &) {
|
||||
value = "Invalid";
|
||||
}
|
||||
@@ -636,11 +636,11 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.time64", sizeof(u64), [](auto buffer, auto endian, auto style) {
|
||||
std::ignore = style;
|
||||
|
||||
auto endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<u64 *>(buffer.data()), endian);
|
||||
time_t endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<u64 *>(buffer.data()), endian);
|
||||
|
||||
std::string value;
|
||||
try {
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", fmt::localtime(endianAdjustedTime));
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", *std::localtime(&endianAdjustedTime));
|
||||
} catch (fmt::format_error &) {
|
||||
value = "Invalid";
|
||||
}
|
||||
@@ -653,11 +653,11 @@ namespace hex::plugin::builtin {
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.time", sizeof(time_t), [](auto buffer, auto endian, auto style) {
|
||||
std::ignore = style;
|
||||
|
||||
auto endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<time_t *>(buffer.data()), endian);
|
||||
time_t endianAdjustedTime = hex::changeEndianness(*reinterpret_cast<time_t *>(buffer.data()), endian);
|
||||
|
||||
std::string value;
|
||||
try {
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", fmt::localtime(endianAdjustedTime));
|
||||
value = hex::format("{0:%a, %d.%m.%Y %H:%M:%S}", *std::localtime(&endianAdjustedTime));
|
||||
} catch (fmt::format_error &e) {
|
||||
value = "Invalid";
|
||||
}
|
||||
|
||||
@@ -135,14 +135,14 @@ namespace hex::plugin::builtin {
|
||||
if (m_fileStats.has_value()) {
|
||||
std::string creationTime, accessTime, modificationTime;
|
||||
|
||||
try { creationTime = hex::format("{:%Y-%m-%d %H:%M:%S}", fmt::localtime(m_fileStats->st_ctime)); }
|
||||
catch (const std::exception&) { creationTime = "???"; }
|
||||
try { creationTime = hex::format("{:%Y-%m-%d %H:%M:%S}", *std::localtime(&m_fileStats->st_ctime)); }
|
||||
catch (const fmt::format_error&) { creationTime = "???"; }
|
||||
|
||||
try { accessTime = hex::format("{:%Y-%m-%d %H:%M:%S}", fmt::localtime(m_fileStats->st_atime)); }
|
||||
catch (const std::exception&) { accessTime = "???"; }
|
||||
try { accessTime = hex::format("{:%Y-%m-%d %H:%M:%S}", *std::localtime(&m_fileStats->st_atime)); }
|
||||
catch (const fmt::format_error&) { accessTime = "???"; }
|
||||
|
||||
try { modificationTime = hex::format("{:%Y-%m-%d %H:%M:%S}", fmt::localtime(m_fileStats->st_mtime)); }
|
||||
catch (const std::exception&) { modificationTime = "???"; }
|
||||
try { modificationTime = hex::format("{:%Y-%m-%d %H:%M:%S}", *std::localtime(&m_fileStats->st_mtime)); }
|
||||
catch (const fmt::format_error&) { modificationTime = "???"; }
|
||||
|
||||
result.emplace_back("hex.builtin.provider.file.creation"_lang, creationTime);
|
||||
result.emplace_back("hex.builtin.provider.file.access"_lang, accessTime);
|
||||
|
||||
Reference in New Issue
Block a user