1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:37:34 +00:00

LibTimeZone: Parse ZONE entries from the TZDB and generate their names

This commit is contained in:
Timothy Flynn 2021-12-28 12:53:53 -05:00 committed by Linus Groh
parent 41f4a5050c
commit 9253e695d1
5 changed files with 260 additions and 4 deletions

View file

@ -6,3 +6,15 @@ if (DEFINED TIME_ZONE_DATA_SOURCES)
target_compile_options(LibTimeZoneData PRIVATE -g0 -Os)
target_link_libraries(LibTimeZoneData LibCore)
endif()
set(SOURCES
TimeZone.cpp
)
serenity_lib(LibTimeZone timezone)
target_link_libraries(LibTimeZone LibCore)
target_compile_definitions(LibTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
if (DEFINED TIME_ZONE_DATA_SOURCES)
target_link_libraries(LibTimeZone LibTimeZoneData)
endif()

View file

@ -0,0 +1,15 @@
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
namespace TimeZone {
enum class TimeZone : u16;
}

View file

@ -0,0 +1,13 @@
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTimeZone/TimeZone.h>
namespace TimeZone {
Optional<TimeZone> __attribute__((weak)) time_zone_from_string(StringView) { return {}; }
}

View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/StringView.h>
#include <LibTimeZone/Forward.h>
namespace TimeZone {
Optional<TimeZone> time_zone_from_string(StringView time_zone);
}