Coverage Report

Created: 2026-07-11 06:47

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
512k
absl::string_view KindToString(Kind kind) {
22
512k
  switch (kind) {
23
1.27k
    case Kind::kNullType:
24
1.27k
      return "null_type";
25
0
    case Kind::kDyn:
26
0
      return "dyn";
27
0
    case Kind::kAny:
28
0
      return "any";
29
2.25k
    case Kind::kType:
30
2.25k
      return "type";
31
0
    case Kind::kTypeParam:
32
0
      return "type_param";
33
0
    case Kind::kFunction:
34
0
      return "function";
35
205k
    case Kind::kBool:
36
205k
      return "bool";
37
235k
    case Kind::kInt:
38
235k
      return "int";
39
13.6k
    case Kind::kUint:
40
13.6k
      return "uint";
41
36.4k
    case Kind::kDouble:
42
36.4k
      return "double";
43
956
    case Kind::kString:
44
956
      return "string";
45
9.22k
    case Kind::kBytes:
46
9.22k
      return "bytes";
47
267
    case Kind::kDuration:
48
267
      return "duration";
49
5
    case Kind::kTimestamp:
50
5
      return "timestamp";
51
6.67k
    case Kind::kList:
52
6.67k
      return "list";
53
666
    case Kind::kMap:
54
666
      return "map";
55
24
    case Kind::kStruct:
56
24
      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
512k
  }
78
512k
}
79
80
}  // namespace cel