
LibCore currently cannot depend on LibTimeZone directly. All build-time code generators depend on LibCore, so there'd be a circular dependency: LibCore -> LibTimeZone -> GenerateTZData -> LibCore. So to support parsing time zone names and applying their offsets, add a couple of weakly-defined helper functions. These work similar to the way AK::String declares some methods that LibUnicode defines. Any user who wants to parse time zone names (from outside of LibCore itself) can link against LibTimeZone to receive full support.
19 lines
435 B
C++
19 lines
435 B
C++
/*
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <AK/StringView.h>
|
|
#include <AK/Time.h>
|
|
|
|
// This file contains definitions of Core::DateTime methods which require TZDB data.
|
|
namespace Core {
|
|
|
|
Optional<StringView> parse_time_zone_name(GenericLexer&);
|
|
void apply_time_zone_offset(StringView time_zone, UnixDateTime& time);
|
|
|
|
}
|