MCPcopy Create free account
hub / github.com/apache/arrow / FormatYYYY_MM_DD

Function FormatYYYY_MM_DD

cpp/src/arrow/util/formatting.h:347–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347inline void FormatYYYY_MM_DD(arrow_vendored::date::year_month_day ymd, char** cursor) {
348 FormatTwoDigits(static_cast<unsigned>(ymd.day()), cursor);
349 FormatOneChar('-', cursor);
350 FormatTwoDigits(static_cast<unsigned>(ymd.month()), cursor);
351 FormatOneChar('-', cursor);
352 auto year = static_cast<int>(ymd.year());
353 const auto is_neg_year = year < 0;
354 year = std::abs(year);
355 assert(year <= 99999);
356 FormatTwoDigits(year % 100, cursor);
357 year /= 100;
358 FormatTwoDigits(year % 100, cursor);
359 if (year >= 100) {
360 FormatOneDigit(year / 100, cursor);
361 }
362 if (is_neg_year) {
363 FormatOneChar('-', cursor);
364 }
365}
366
367template <typename Duration>
368constexpr size_t BufferSizeHH_MM_SS() {

Callers 2

FormatDaysMethod · 0.85
operator()Method · 0.85

Calls 3

FormatTwoDigitsFunction · 0.85
FormatOneCharFunction · 0.85
FormatOneDigitFunction · 0.85

Tested by

no test coverage detected