Coverage Report

Created: 2026-08-07 09:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/core/uint24.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "core/uint24.h"
19
20
#include <fmt/compile.h>
21
#include <fmt/format.h>
22
23
namespace doris {
24
25
2
std::string uint24_t::to_string() const {
26
2
    int value = *reinterpret_cast<const uint24_t*>(data);
27
2
    int mday = value & 31;
28
2
    int mon = value >> 5 & 15;
29
2
    int year = value >> 9;
30
31
    return fmt::format(FMT_COMPILE("{:04d}-{:02d}-{:02d}"), year, mon, mday);
32
2
}
33
34
} // namespace doris