mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
AK: Remove unused class DOSPackedTime
This commit is contained in:
parent
fa00fcb843
commit
884c98ef4b
4 changed files with 0 additions and 90 deletions
|
@ -6,7 +6,6 @@ set(SOURCES
|
||||||
CircularBuffer.cpp
|
CircularBuffer.cpp
|
||||||
ConstrainedStream.cpp
|
ConstrainedStream.cpp
|
||||||
CountingStream.cpp
|
CountingStream.cpp
|
||||||
DOSPackedTime.cpp
|
|
||||||
Error.cpp
|
Error.cpp
|
||||||
FloatingPointStringConversions.cpp
|
FloatingPointStringConversions.cpp
|
||||||
FlyString.cpp
|
FlyString.cpp
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2022, Undefine <undefine@undefine.pl>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <AK/DOSPackedTime.h>
|
|
||||||
|
|
||||||
namespace AK {
|
|
||||||
|
|
||||||
UnixDateTime time_from_packed_dos(DOSPackedDate date, DOSPackedTime time)
|
|
||||||
{
|
|
||||||
if (date.value == 0)
|
|
||||||
return UnixDateTime::from_unix_time_parts(first_dos_year, 1, 1, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
return UnixDateTime::from_unix_time_parts(first_dos_year + date.year, date.month, date.day, time.hour, time.minute, time.second * 2, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
DOSPackedDate to_packed_dos_date(unsigned year, unsigned month, unsigned day)
|
|
||||||
{
|
|
||||||
DOSPackedDate date;
|
|
||||||
date.year = year - first_dos_year;
|
|
||||||
date.month = month;
|
|
||||||
date.day = day;
|
|
||||||
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
DOSPackedTime to_packed_dos_time(unsigned hour, unsigned minute, unsigned second)
|
|
||||||
{
|
|
||||||
DOSPackedTime time;
|
|
||||||
time.hour = hour;
|
|
||||||
time.minute = minute;
|
|
||||||
time.second = second / 2;
|
|
||||||
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2022, Undefine <undefine@undefine.pl>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <AK/Time.h>
|
|
||||||
#include <AK/Types.h>
|
|
||||||
|
|
||||||
namespace AK {
|
|
||||||
|
|
||||||
union DOSPackedTime {
|
|
||||||
u16 value;
|
|
||||||
struct {
|
|
||||||
u16 second : 5;
|
|
||||||
u16 minute : 6;
|
|
||||||
u16 hour : 5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
static_assert(sizeof(DOSPackedTime) == 2);
|
|
||||||
|
|
||||||
union DOSPackedDate {
|
|
||||||
u16 value;
|
|
||||||
struct {
|
|
||||||
u16 day : 5;
|
|
||||||
u16 month : 4;
|
|
||||||
u16 year : 7;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
static_assert(sizeof(DOSPackedDate) == 2);
|
|
||||||
|
|
||||||
inline constexpr u16 first_dos_year = 1980;
|
|
||||||
|
|
||||||
UnixDateTime time_from_packed_dos(DOSPackedDate, DOSPackedTime);
|
|
||||||
DOSPackedDate to_packed_dos_date(unsigned year, unsigned month, unsigned day);
|
|
||||||
DOSPackedTime to_packed_dos_time(unsigned hour, unsigned minute, unsigned second);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#if USING_AK_GLOBALLY
|
|
||||||
using AK::DOSPackedDate;
|
|
||||||
using AK::DOSPackedTime;
|
|
||||||
using AK::time_from_packed_dos;
|
|
||||||
using AK::to_packed_dos_date;
|
|
||||||
using AK::to_packed_dos_time;
|
|
||||||
#endif
|
|
|
@ -58,8 +58,6 @@ shared_library("AK") {
|
||||||
"CopyOnWrite.h",
|
"CopyOnWrite.h",
|
||||||
"CountingStream.cpp",
|
"CountingStream.cpp",
|
||||||
"CountingStream.h",
|
"CountingStream.h",
|
||||||
"DOSPackedTime.cpp",
|
|
||||||
"DOSPackedTime.h",
|
|
||||||
"DateConstants.h",
|
"DateConstants.h",
|
||||||
"DefaultDelete.h",
|
"DefaultDelete.h",
|
||||||
"Demangle.h",
|
"Demangle.h",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue