MCPcopy Create free account
hub / github.com/apache/orc / parseTimeVariants

Method parseTimeVariants

c++/src/Timezone.cc:824–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822 }
823
824 void TimezoneImpl::parseTimeVariants(const unsigned char* ptr, uint64_t variantOffset,
825 uint64_t variantCount, uint64_t nameOffset,
826 uint64_t nameCount) {
827 for (uint64_t variant = 0; variant < variantCount; ++variant) {
828 variants_[variant].gmtOffset =
829 static_cast<int32_t>(decode32(ptr + variantOffset + 6 * variant));
830 variants_[variant].isDst = ptr[variantOffset + 6 * variant + 4] != 0;
831 uint64_t nameStart = ptr[variantOffset + 6 * variant + 5];
832 if (nameStart >= nameCount) {
833 std::stringstream buffer;
834 buffer << "name out of range in variant " << variant << " - " << nameStart
835 << " >= " << nameCount;
836 throw TimezoneError(buffer.str());
837 }
838 variants_[variant].name =
839 std::string(reinterpret_cast<const char*>(ptr) + nameOffset + nameStart);
840 }
841 }
842
843 /**
844 * Parse the zone file to get the bits we need.

Callers

nothing calls this directly

Calls 2

decode32Function · 0.85
TimezoneErrorClass · 0.85

Tested by

no test coverage detected