|
||||
File indexing completed on 2025-01-18 09:27:29
0001 // Copyright 2016 Google Inc. All Rights Reserved. 0002 // 0003 // Licensed under the Apache License, Version 2.0 (the "License"); 0004 // you may not use this file except in compliance with the License. 0005 // You may obtain a copy of the License at 0006 // 0007 // https://www.apache.org/licenses/LICENSE-2.0 0008 // 0009 // Unless required by applicable law or agreed to in writing, software 0010 // distributed under the License is distributed on an "AS IS" BASIS, 0011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0012 // See the License for the specific language governing permissions and 0013 // limitations under the License. 0014 0015 #ifndef ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_FIXED_H_ 0016 #define ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_FIXED_H_ 0017 0018 #include <string> 0019 0020 #include "absl/base/config.h" 0021 #include "absl/time/internal/cctz/include/cctz/time_zone.h" 0022 0023 namespace absl { 0024 ABSL_NAMESPACE_BEGIN 0025 namespace time_internal { 0026 namespace cctz { 0027 0028 // Helper functions for dealing with the names and abbreviations 0029 // of time zones that are a fixed offset (seconds east) from UTC. 0030 // FixedOffsetFromName() extracts the offset from a valid fixed-offset 0031 // name, while FixedOffsetToName() and FixedOffsetToAbbr() generate 0032 // the canonical zone name and abbreviation respectively for the given 0033 // offset. 0034 // 0035 // A fixed-offset name looks like "Fixed/UTC<+-><hours>:<mins>:<secs>". 0036 // Its abbreviation is of the form "UTC(<+->H?H(MM(SS)?)?)?" where the 0037 // optional pieces are omitted when their values are zero. (Note that 0038 // the sign is the opposite of that used in a POSIX TZ specification.) 0039 // 0040 // Note: FixedOffsetFromName() fails on syntax errors or when the parsed 0041 // offset exceeds 24 hours. FixedOffsetToName() and FixedOffsetToAbbr() 0042 // both produce "UTC" when the argument offset exceeds 24 hours. 0043 bool FixedOffsetFromName(const std::string& name, seconds* offset); 0044 std::string FixedOffsetToName(const seconds& offset); 0045 std::string FixedOffsetToAbbr(const seconds& offset); 0046 0047 } // namespace cctz 0048 } // namespace time_internal 0049 ABSL_NAMESPACE_END 0050 } // namespace absl 0051 0052 #endif // ABSL_TIME_INTERNAL_CCTZ_TIME_ZONE_FIXED_H_
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |