• Home
  • Raw
  • Download

Lines Matching +full:magic +full:- +full:string

2 // Use of this source code is governed by a BSD-style license that can be
9 #include <string.h>
22 char magic[4]; member
36 int read = file->ReadAtCurrentPos(reinterpret_cast<char*>(&buf), sizeof(buf)); in ReadInt()
40 // Values are stored in network byte order (highest-order byte first). in ReadInt()
48 int read = tzfile->ReadAtCurrentPos(header->magic, sizeof(header->magic)); in ParseTzifHeader()
49 if (read != sizeof(header->magic)) { in ParseTzifHeader()
52 if (memcmp(header->magic, "TZif", 4) != 0) { in ParseTzifHeader()
56 read = tzfile->ReadAtCurrentPos(&header->version, sizeof(header->version)); in ParseTzifHeader()
57 if (read != sizeof(header->version)) { in ParseTzifHeader()
60 if (header->version != '\0' && header->version != '2' && in ParseTzifHeader()
61 header->version != '3') { in ParseTzifHeader()
65 read = tzfile->ReadAtCurrentPos(header->reserved, sizeof(header->reserved)); in ParseTzifHeader()
66 if (read != sizeof(header->reserved)) { in ParseTzifHeader()
69 for (size_t i = 0; i < sizeof(header->reserved); i++) { in ParseTzifHeader()
70 if (header->reserved[i] != 0) { in ParseTzifHeader()
75 if (!ReadInt(tzfile, &header->ttisgmtcnt) || header->ttisgmtcnt < 0) { in ParseTzifHeader()
78 if (!ReadInt(tzfile, &header->ttisstdcnt) || header->ttisstdcnt < 0) { in ParseTzifHeader()
81 if (!ReadInt(tzfile, &header->leapcnt) || header->leapcnt < 0) { in ParseTzifHeader()
84 if (!ReadInt(tzfile, &header->timecnt) || header->timecnt < 0) { in ParseTzifHeader()
87 if (!ReadInt(tzfile, &header->typecnt) || header->typecnt < 0) { in ParseTzifHeader()
90 if (!ReadInt(tzfile, &header->charcnt) || header->charcnt < 0) { in ParseTzifHeader()
102 base::Optional<std::string> GetPosixTimezone(const base::FilePath& tzif_path) { in GetPosixTimezone()
116 // Generating a POSIX-style TZ string from a TZif version 1 file is hard; in GetPosixTimezone()
120 // the newer versions of the timezone-data package. in GetPosixTimezone()
127 // TZif versions 2 and 3 embed a POSIX-style TZ string after their in GetPosixTimezone()
151 std::string time_string(tzfile.GetLength() - offset, '\0'); in GetPosixTimezone()
157 // According to the spec, the embedded string is enclosed by '\n' characters. in GetPosixTimezone()