Coverage Report

Created: 2026-07-16 06:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/common/kind.cc
Line
Count
Source
1
// Copyright 2023 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#include "common/kind.h"
16
17
#include "absl/strings/string_view.h"
18
19
namespace cel {
20
21
661k
absl::string_view KindToString(Kind kind) {
22
661k
  switch (kind) {
23
722
    case Kind::kNullType:
24
722
      return "null_type";
25
0
    case Kind::kDyn:
26
0
      return "dyn";
27
0
    case Kind::kAny:
28
0
      return "any";
29
3.09k
    case Kind::kType:
30
3.09k
      return "type";
31
0
    case Kind::kTypeParam:
32
0
      return "type_param";
33
0
    case Kind::kFunction:
34
0
      return "function";
35
217k
    case Kind::kBool:
36
217k
      return "bool";
37
242k
    case Kind::kInt:
38
242k
      return "int";
39
58.1k
    case Kind::kUint:
40
58.1k
      return "uint";
41
64.7k
    case Kind::kDouble:
42
64.7k
      return "double";
43
35.5k
    case Kind::kString:
44
35.5k
      return "string";
45
32.5k
    case Kind::kBytes:
46
32.5k
      return "bytes";
47
1.46k
    case Kind::kDuration:
48
1.46k
      return "duration";
49
48
    case Kind::kTimestamp:
50
48
      return "timestamp";
51
3.42k
    case Kind::kList:
52
3.42k
      return "list";
53
739
    case Kind::kMap:
54
739
      return "map";
55
9
    case Kind::kStruct:
56
9
      return "struct";
57
0
    case Kind::kUnknown:
58
0
      return "*unknown*";
59
0
    case Kind::kOpaque:
60
0
      return "*opaque*";
61
0
    case Kind::kBoolWrapper:
62
0
      return "google.protobuf.BoolValue";
63
0
    case Kind::kIntWrapper:
64
0
      return "google.protobuf.Int64Value";
65
0
    case Kind::kUintWrapper:
66
0
      return "google.protobuf.UInt64Value";
67
0
    case Kind::kDoubleWrapper:
68
0
      return "google.protobuf.DoubleValue";
69
0
    case Kind::kStringWrapper:
70
0
      return "google.protobuf.StringValue";
71
0
    case Kind::kBytesWrapper:
72
0
      return "google.protobuf.BytesValue";
73
0
    case Kind::kEnum:
74
0
      return "enum";
75
0
    default:
76
0
      return "*error*";
77
661k
  }
78
661k
}
79
80
}  // namespace cel