1*1a96fba6SXin Li // Copyright 2020 The Chromium OS Authors. All rights reserved. 2*1a96fba6SXin Li // Use of this source code is governed by a BSD-style license that can be 3*1a96fba6SXin Li // found in the LICENSE file. 4*1a96fba6SXin Li 5*1a96fba6SXin Li #ifndef LIBBRILLO_BRILLO_TIMEZONE_TZIF_PARSER_H_ 6*1a96fba6SXin Li #define LIBBRILLO_BRILLO_TIMEZONE_TZIF_PARSER_H_ 7*1a96fba6SXin Li 8*1a96fba6SXin Li #include <string> 9*1a96fba6SXin Li 10*1a96fba6SXin Li #include <base/files/file_path.h> 11*1a96fba6SXin Li #include <base/optional.h> 12*1a96fba6SXin Li #include <brillo/brillo_export.h> 13*1a96fba6SXin Li 14*1a96fba6SXin Li namespace brillo { 15*1a96fba6SXin Li 16*1a96fba6SXin Li namespace timezone { 17*1a96fba6SXin Li 18*1a96fba6SXin Li // GetPosixTimezone takes a path to a tzfile, and returns the POSIX timezone in 19*1a96fba6SXin Li // a string. See 'man tzfile' for more info on the format. If |tzif_path| is a 20*1a96fba6SXin Li // relative path, it will be appended to /usr/share/zoneinfo/, otherwise 21*1a96fba6SXin Li // |tzif_path| as an absolute path will be used directly. 22*1a96fba6SXin Li base::Optional<std::string> BRILLO_EXPORT GetPosixTimezone( 23*1a96fba6SXin Li const base::FilePath& tzif_path); 24*1a96fba6SXin Li 25*1a96fba6SXin Li } // namespace timezone 26*1a96fba6SXin Li 27*1a96fba6SXin Li } // namespace brillo 28*1a96fba6SXin Li 29*1a96fba6SXin Li #endif // LIBBRILLO_BRILLO_TIMEZONE_TZIF_PARSER_H_ 30