Coverage Report

Created: 2026-05-27 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/common/internal/byte_string.h
Line
Count
Source
1
// Copyright 2024 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
#ifndef THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_BYTE_STRING_H_
16
#define THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_BYTE_STRING_H_
17
18
#include <cstddef>
19
#include <cstdint>
20
#include <new>
21
#include <ostream>
22
#include <string>
23
#include <type_traits>
24
#include <utility>
25
26
#include "absl/base/attributes.h"
27
#include "absl/base/nullability.h"
28
#include "absl/base/optimization.h"
29
#include "absl/functional/overload.h"
30
#include "absl/hash/hash.h"
31
#include "absl/log/absl_check.h"
32
#include "absl/strings/cord.h"
33
#include "absl/strings/string_view.h"
34
#include "absl/types/optional.h"
35
#include "common/allocator.h"
36
#include "common/arena.h"
37
#include "common/internal/reference_count.h"
38
#include "common/memory.h"
39
#include "google/protobuf/arena.h"
40
41
namespace cel {
42
43
class BytesValueInputStream;
44
class BytesValueOutputStream;
45
class StringValue;
46
47
namespace common_internal {
48
49
// absl::Cord is trivially relocatable IFF we are not using ASan or MSan. When
50
// using ASan or MSan absl::Cord will poison/unpoison its inline storage.
51
#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || defined(ABSL_HAVE_MEMORY_SANITIZER)
52
#define CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI
53
#else
54
#define CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI ABSL_ATTRIBUTE_TRIVIAL_ABI
55
#endif
56
57
class CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI [[nodiscard]] ByteString;
58
59
struct ByteStringTestFriend;
60
61
enum class ByteStringKind : unsigned int {
62
  kSmall = 0,
63
  kMedium,
64
  kLarge,
65
};
66
67
0
inline std::ostream& operator<<(std::ostream& out, ByteStringKind kind) {
68
0
  switch (kind) {
69
0
    case ByteStringKind::kSmall:
70
0
      return out << "SMALL";
71
0
    case ByteStringKind::kMedium:
72
0
      return out << "MEDIUM";
73
0
    case ByteStringKind::kLarge:
74
0
      return out << "LARGE";
75
0
  }
76
0
}
77
78
// Representation of small strings in ByteString, which are stored in place.
79
struct CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI SmallByteStringRep final {
80
#ifdef _MSC_VER
81
#pragma pack(push, 1)
82
#endif
83
  struct ABSL_ATTRIBUTE_PACKED CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI {
84
    std::uint8_t kind : 2;
85
    std::uint8_t size : 6;
86
  };
87
#ifdef _MSC_VER
88
#pragma pack(pop)
89
#endif
90
  char data[23 - sizeof(google::protobuf::Arena*)];
91
  google::protobuf::Arena* absl_nullable arena;
92
};
93
94
inline constexpr size_t kSmallByteStringCapacity =
95
    sizeof(SmallByteStringRep::data);
96
97
inline constexpr size_t kMediumByteStringSizeBits = sizeof(size_t) * 8 - 2;
98
inline constexpr size_t kMediumByteStringMaxSize =
99
    (size_t{1} << kMediumByteStringSizeBits) - 1;
100
101
inline constexpr size_t kByteStringViewSizeBits = sizeof(size_t) * 8 - 1;
102
inline constexpr size_t kByteStringViewMaxSize =
103
    (size_t{1} << kByteStringViewSizeBits) - 1;
104
105
// Representation of medium strings in ByteString. These are either owned by an
106
// arena or managed by a reference count. This is encoded in `owner` following
107
// the same semantics as `cel::Owner`.
108
struct CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI MediumByteStringRep final {
109
#ifdef _MSC_VER
110
#pragma pack(push, 1)
111
#endif
112
  struct ABSL_ATTRIBUTE_PACKED CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI {
113
    size_t kind : 2;
114
    size_t size : kMediumByteStringSizeBits;
115
  };
116
#ifdef _MSC_VER
117
#pragma pack(pop)
118
#endif
119
  const char* data;
120
  uintptr_t owner;
121
};
122
123
// Representation of large strings in ByteString. These are stored as
124
// `absl::Cord` and never owned by an arena.
125
struct CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI LargeByteStringRep final {
126
#ifdef _MSC_VER
127
#pragma pack(push, 1)
128
#endif
129
  struct ABSL_ATTRIBUTE_PACKED CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI {
130
    size_t kind : 2;
131
    size_t padding : kMediumByteStringSizeBits;
132
  };
133
#ifdef _MSC_VER
134
#pragma pack(pop)
135
#endif
136
  alignas(absl::Cord) std::byte data[sizeof(absl::Cord)];
137
};
138
139
// Representation of ByteString.
140
union CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI ByteStringRep final {
141
#ifdef _MSC_VER
142
#pragma pack(push, 1)
143
#endif
144
  struct ABSL_ATTRIBUTE_PACKED CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI {
145
    ByteStringKind kind : 2;
146
  } header;
147
#ifdef _MSC_VER
148
#pragma pack(pop)
149
#endif
150
  SmallByteStringRep small;
151
  MediumByteStringRep medium;
152
  LargeByteStringRep large;
153
};
154
155
// Returns a `absl::string_view` from `ByteString`, using `arena` to make memory
156
// allocations if necessary. `stable` indicates whether `cel::Value` is in a
157
// location where it will not be moved, so that inline string/bytes storage can
158
// be referenced.
159
absl::string_view LegacyByteString(const ByteString& string, bool stable,
160
                                   google::protobuf::Arena* absl_nonnull arena);
161
162
// `ByteString` is a vocabulary type capable of representing copy-on-write
163
// strings efficiently for arenas and reference counting. The contents of the
164
// byte string are owned by an arena or managed by a reference count. All byte
165
// strings have an associated allocator specified at construction, once the byte
166
// string is constructed the allocator will not and cannot change. Copying and
167
// moving between different allocators is supported and dealt with
168
// transparently by copying.
169
class CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI [[nodiscard]]
170
ByteString final {
171
 public:
172
  static ByteString Concat(const ByteString& lhs, const ByteString& rhs,
173
                           google::protobuf::Arena* absl_nonnull arena);
174
175
1.35k
  ByteString() : ByteString(NewDeleteAllocator()) {}
176
177
  explicit ByteString(const char* absl_nullable string)
178
1
      : ByteString(NewDeleteAllocator(), string) {}
179
180
  explicit ByteString(absl::string_view string)
181
16.4k
      : ByteString(NewDeleteAllocator(), string) {}
182
183
  explicit ByteString(const std::string& string)
184
0
      : ByteString(NewDeleteAllocator(), string) {}
185
186
  explicit ByteString(std::string&& string)
187
6
      : ByteString(NewDeleteAllocator(), std::move(string)) {}
188
189
  explicit ByteString(const absl::Cord& cord)
190
0
      : ByteString(NewDeleteAllocator(), cord) {}
191
192
14.5k
  ByteString(const ByteString& other) noexcept {
193
14.5k
    Construct(other, /*allocator=*/absl::nullopt);
194
14.5k
  }
195
196
103k
  ByteString(ByteString&& other) noexcept {
197
103k
    Construct(other, /*allocator=*/absl::nullopt);
198
103k
  }
199
200
1.35k
  explicit ByteString(Allocator<> allocator) {
201
1.35k
    SetSmallEmpty(allocator.arena());
202
1.35k
  }
203
204
  ByteString(Allocator<> allocator, const char* absl_nullable string)
205
1
      : ByteString(allocator, absl::NullSafeStringView(string)) {}
206
207
  ByteString(Allocator<> allocator, absl::string_view string);
208
209
  ByteString(Allocator<> allocator, const std::string& string);
210
211
  ByteString(Allocator<> allocator, std::string&& string);
212
213
  ByteString(Allocator<> allocator, const absl::Cord& cord);
214
215
0
  ByteString(Allocator<> allocator, const ByteString& other) {
216
0
    Construct(other, allocator);
217
0
  }
218
219
0
  ByteString(Allocator<> allocator, ByteString&& other) {
220
0
    Construct(other, allocator);
221
0
  }
222
223
  ByteString(Borrower borrower,
224
             const char* absl_nullable string ABSL_ATTRIBUTE_LIFETIME_BOUND)
225
0
      : ByteString(borrower, absl::NullSafeStringView(string)) {}
226
227
  ByteString(Borrower borrower,
228
             absl::string_view string ABSL_ATTRIBUTE_LIFETIME_BOUND)
229
128
      : ByteString(Borrowed(borrower, string)) {}
230
231
  ByteString(Borrower borrower,
232
             const absl::Cord& cord ABSL_ATTRIBUTE_LIFETIME_BOUND)
233
0
      : ByteString(Borrowed(borrower, cord)) {}
234
235
  // Creates a medium byte string that is backed by an external string. Should
236
  // only be called from explicit 'Unsafe' factories.
237
  static ByteString FromExternal(absl::string_view string);
238
239
136k
  ~ByteString() { Destroy(); }
240
241
324
  ByteString& operator=(const ByteString& other) noexcept {
242
324
    if (ABSL_PREDICT_TRUE(this != &other)) {
243
324
      CopyFrom(other);
244
324
    }
245
324
    return *this;
246
324
  }
247
248
430
  ByteString& operator=(ByteString&& other) noexcept {
249
430
    if (ABSL_PREDICT_TRUE(this != &other)) {
250
430
      MoveFrom(other);
251
430
    }
252
430
    return *this;
253
430
  }
254
255
  bool empty() const;
256
257
  size_t size() const;
258
259
0
  size_t max_size() const { return kByteStringViewMaxSize; }
260
261
  absl::string_view Flatten() ABSL_ATTRIBUTE_LIFETIME_BOUND;
262
263
  absl::optional<absl::string_view> TryFlat() const
264
      ABSL_ATTRIBUTE_LIFETIME_BOUND;
265
266
  bool Equals(absl::string_view rhs) const;
267
  bool Equals(const absl::Cord& rhs) const;
268
  bool Equals(const ByteString& rhs) const;
269
270
  int Compare(absl::string_view rhs) const;
271
  int Compare(const absl::Cord& rhs) const;
272
  int Compare(const ByteString& rhs) const;
273
274
  bool StartsWith(absl::string_view rhs) const;
275
  bool StartsWith(const absl::Cord& rhs) const;
276
  bool StartsWith(const ByteString& rhs) const;
277
278
  bool EndsWith(absl::string_view rhs) const;
279
  bool EndsWith(const absl::Cord& rhs) const;
280
  bool EndsWith(const ByteString& rhs) const;
281
282
  // Finds the first occurrence of `needle` in this object, starting at byte
283
  // position `pos`. Returns `absl::nullopt` if `needle` is not found.
284
  // Note: Positions are byte-based, not code point based as in
285
  // `cel::StringValue`.
286
  absl::optional<size_t> Find(absl::string_view needle, size_t pos = 0) const;
287
  absl::optional<size_t> Find(const absl::Cord& needle, size_t pos = 0) const;
288
  absl::optional<size_t> Find(const ByteString& needle, size_t pos = 0) const;
289
290
  // Returns a new `ByteString` that is a substring of this object, starting at
291
  // byte position `pos` and with a length of `npos` bytes.
292
  // Note: Positions are byte-based, not code point based as in
293
  // `cel::StringValue`.
294
  ByteString Substring(size_t pos, size_t npos) const;
295
0
  ByteString Substring(size_t pos) const {
296
0
    ABSL_DCHECK_LE(pos, size());
297
0
    return Substring(pos, size());
298
0
  }
299
300
  void RemovePrefix(size_t n);
301
302
  void RemoveSuffix(size_t n);
303
304
  std::string ToString() const;
305
306
  void CopyToString(std::string* absl_nonnull out) const;
307
308
  void AppendToString(std::string* absl_nonnull out) const;
309
310
  absl::Cord ToCord() const&;
311
312
  absl::Cord ToCord() &&;
313
314
  void CopyToCord(absl::Cord* absl_nonnull out) const;
315
316
  void AppendToCord(absl::Cord* absl_nonnull out) const;
317
318
  absl::string_view ToStringView(
319
      std::string* absl_nonnull scratch
320
          ABSL_ATTRIBUTE_LIFETIME_BOUND) const ABSL_ATTRIBUTE_LIFETIME_BOUND;
321
322
  absl::string_view AsStringView() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
323
324
  google::protobuf::Arena* absl_nullable GetArena() const;
325
326
  ByteString Clone(google::protobuf::Arena* absl_nonnull arena) const;
327
328
  void HashValue(absl::HashState state) const;
329
330
  template <typename Visitor>
331
9.55k
  decltype(auto) Visit(Visitor&& visitor) const {
332
9.55k
    switch (GetKind()) {
333
7.12k
      case ByteStringKind::kSmall:
334
7.12k
        return std::forward<Visitor>(visitor)(GetSmall());
335
2.42k
      case ByteStringKind::kMedium:
336
2.42k
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
9.55k
    }
340
9.55k
  }
decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Equals(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Equals(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Line
Count
Source
331
155
  decltype(auto) Visit(Visitor&& visitor) const {
332
155
    switch (GetKind()) {
333
81
      case ByteStringKind::kSmall:
334
81
        return std::forward<Visitor>(visitor)(GetSmall());
335
74
      case ByteStringKind::kMedium:
336
74
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
155
    }
340
155
  }
decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Compare(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Compare(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Line
Count
Source
331
775
  decltype(auto) Visit(Visitor&& visitor) const {
332
775
    switch (GetKind()) {
333
658
      case ByteStringKind::kSmall:
334
658
        return std::forward<Visitor>(visitor)(GetSmall());
335
117
      case ByteStringKind::kMedium:
336
117
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
775
    }
340
775
  }
Unexecuted instantiation: decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::StartsWith(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::StartsWith(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Unexecuted instantiation: decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::EndsWith(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(cel::common_internal::ByteString const&) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::EndsWith(cel::common_internal::ByteString const&) const::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Unexecuted instantiation: decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(cel::common_internal::ByteString const&, unsigned long) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Find(cel::common_internal::ByteString const&, unsigned long) const::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(cel::common_internal::ByteString const&, unsigned long) const::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::ByteString::Find(cel::common_internal::ByteString const&, unsigned long) const::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Unexecuted instantiation: decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::IsZeroValue() const::{lambda(auto:1 const&)#1}>(cel::BytesValue::IsZeroValue() const::{lambda(auto:1 const&)#1}&&) const
Unexecuted instantiation: decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::IsZeroValue() const::{lambda(auto:1 const&)#1}>(cel::StringValue::IsZeroValue() const::{lambda(auto:1 const&)#1}&&) const
Unexecuted instantiation: regex_match_step.cc:decltype(auto) cel::common_internal::ByteString::Visit<google::api::expr::runtime::(anonymous namespace)::MatchesVisitor>(google::api::expr::runtime::(anonymous namespace)::MatchesVisitor&&) const
type_conversion_functions.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::(anonymous namespace)::RegisterStringConversionFunctions(cel::FunctionRegistry&, cel::RuntimeOptions const&)::$_0::operator()(cel::BytesValue const&) const::{lambda(auto:1 const&)#1}>(cel::(anonymous namespace)::RegisterStringConversionFunctions(cel::FunctionRegistry&, cel::RuntimeOptions const&)::$_0::operator()(cel::BytesValue const&) const::{lambda(auto:1 const&)#1}&&) const
Line
Count
Source
331
7
  decltype(auto) Visit(Visitor&& visitor) const {
332
7
    switch (GetKind()) {
333
4
      case ByteStringKind::kSmall:
334
4
        return std::forward<Visitor>(visitor)(GetSmall());
335
3
      case ByteStringKind::kMedium:
336
3
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
7
    }
340
7
  }
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::(anonymous namespace)::BytesDebugString<cel::BytesValue>(cel::BytesValue const&)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::(anonymous namespace)::BytesDebugString<cel::BytesValue>(cel::BytesValue const&)::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::(anonymous namespace)::BytesDebugString<cel::BytesValue>(cel::BytesValue const&)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::(anonymous namespace)::BytesDebugString<cel::BytesValue>(cel::BytesValue const&)::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0>(cel::BytesValue::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0&&) const
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0>(cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0&&) const
Line
Count
Source
331
152
  decltype(auto) Visit(Visitor&& visitor) const {
332
152
    switch (GetKind()) {
333
122
      case ByteStringKind::kSmall:
334
122
        return std::forward<Visitor>(visitor)(GetSmall());
335
30
      case ByteStringKind::kMedium:
336
30
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
152
    }
340
152
  }
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<std::__1::basic_string_view<char, std::__1::char_traits<char> > >(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&) const::{lambda(auto:1 const&)#1}>(cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<std::__1::basic_string_view<char, std::__1::char_traits<char> > >(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&) const::{lambda(auto:1 const&)#1}&&) const
Line
Count
Source
331
152
  decltype(auto) Visit(Visitor&& visitor) const {
332
152
    switch (GetKind()) {
333
73
      case ByteStringKind::kSmall:
334
73
        return std::forward<Visitor>(visitor)(GetSmall());
335
79
      case ByteStringKind::kMedium:
336
79
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
152
    }
340
152
  }
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<absl::lts_20260107::Cord>(absl::lts_20260107::Cord const&) const::{lambda(auto:1 const&)#1}>(cel::BytesValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<absl::lts_20260107::Cord>(absl::lts_20260107::Cord const&) const::{lambda(auto:1 const&)#1}&&) const
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Size() const::$_0>(cel::BytesValue::Size() const::$_0&&) const
Line
Count
Source
331
2
  decltype(auto) Visit(Visitor&& visitor) const {
332
2
    switch (GetKind()) {
333
1
      case ByteStringKind::kSmall:
334
1
        return std::forward<Visitor>(visitor)(GetSmall());
335
1
      case ByteStringKind::kMedium:
336
1
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
2
    }
340
2
  }
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::IsEmpty() const::$_0>(cel::BytesValue::IsEmpty() const::$_0&&) const
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0>(cel::BytesValue::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0&&) const
Line
Count
Source
331
18
  decltype(auto) Visit(Visitor&& visitor) const {
332
18
    switch (GetKind()) {
333
10
      case ByteStringKind::kSmall:
334
10
        return std::forward<Visitor>(visitor)(GetSmall());
335
8
      case ByteStringKind::kMedium:
336
8
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
18
    }
340
18
  }
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equals(absl::lts_20260107::Cord const&) const::$_0>(cel::BytesValue::Equals(absl::lts_20260107::Cord const&) const::$_0&&) const
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Equals(cel::BytesValue const&) const::$_0>(cel::BytesValue::Equals(cel::BytesValue const&) const::$_0&&) const
Line
Count
Source
331
18
  decltype(auto) Visit(Visitor&& visitor) const {
332
18
    switch (GetKind()) {
333
5
      case ByteStringKind::kSmall:
334
5
        return std::forward<Visitor>(visitor)(GetSmall());
335
13
      case ByteStringKind::kMedium:
336
13
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
18
    }
340
18
  }
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0>(cel::BytesValue::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0&&) const
Line
Count
Source
331
400
  decltype(auto) Visit(Visitor&& visitor) const {
332
400
    switch (GetKind()) {
333
207
      case ByteStringKind::kSmall:
334
207
        return std::forward<Visitor>(visitor)(GetSmall());
335
193
      case ByteStringKind::kMedium:
336
193
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
400
    }
340
400
  }
Unexecuted instantiation: bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Compare(absl::lts_20260107::Cord const&) const::$_0>(cel::BytesValue::Compare(absl::lts_20260107::Cord const&) const::$_0&&) const
bytes_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::BytesValue::Compare(cel::BytesValue const&) const::$_0>(cel::BytesValue::Compare(cel::BytesValue const&) const::$_0&&) const
Line
Count
Source
331
400
  decltype(auto) Visit(Visitor&& visitor) const {
332
400
    switch (GetKind()) {
333
306
      case ByteStringKind::kSmall:
334
306
        return std::forward<Visitor>(visitor)(GetSmall());
335
94
      case ByteStringKind::kMedium:
336
94
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
400
    }
340
400
  }
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Contains(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::Contains(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Contains(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::Contains(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Contains(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::Contains(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Contains(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::Contains(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Contains(cel::StringValue const&) const::$_0, cel::StringValue::Contains(cel::StringValue const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Contains(cel::StringValue const&) const::$_0, cel::StringValue::Contains(cel::StringValue const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::IndexOf(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::IndexOf(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(cel::StringValue const&) const::$_0, cel::StringValue::IndexOf(cel::StringValue const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(cel::StringValue const&) const::$_0, cel::StringValue::IndexOf(cel::StringValue const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_0, cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_0, cel::StringValue::IndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(absl::lts_20260107::Cord const&, long) const::$_0, cel::StringValue::IndexOf(absl::lts_20260107::Cord const&, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(absl::lts_20260107::Cord const&, long) const::$_0, cel::StringValue::IndexOf(absl::lts_20260107::Cord const&, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::IndexOf(cel::StringValue const&, long) const::$_0, cel::StringValue::IndexOf(cel::StringValue const&, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::IndexOf(cel::StringValue const&, long) const::$_0, cel::StringValue::IndexOf(cel::StringValue const&, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&) const::$_0, cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(cel::StringValue const&) const::$_0, cel::StringValue::LastIndexOf(cel::StringValue const&) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(cel::StringValue const&) const::$_0, cel::StringValue::LastIndexOf(cel::StringValue const&) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_0, cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_0, cel::StringValue::LastIndexOf(std::__1::basic_string_view<char, std::__1::char_traits<char> >, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&, long) const::$_0, cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&, long) const::$_0, cel::StringValue::LastIndexOf(absl::lts_20260107::Cord const&, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(cel::StringValue const&, long) const::$_0, cel::StringValue::LastIndexOf(cel::StringValue const&, long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::LastIndexOf(cel::StringValue const&, long) const::$_0, cel::StringValue::LastIndexOf(cel::StringValue const&, long) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Quote(google::protobuf::Arena*) const::$_0, cel::StringValue::Quote(google::protobuf::Arena*) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Quote(google::protobuf::Arena*) const::$_0, cel::StringValue::Quote(google::protobuf::Arena*) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Reverse(google::protobuf::Arena*) const::$_0, cel::StringValue::Reverse(google::protobuf::Arena*) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Reverse(google::protobuf::Arena*) const::$_0, cel::StringValue::Reverse(google::protobuf::Arena*) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Split(cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_0, cel::StringValue::Split(cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Split(cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_0, cel::StringValue::Split(cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::Replace(cel::StringValue const&, cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_0, cel::StringValue::Replace(cel::StringValue const&, cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::Replace(cel::StringValue const&, cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_0, cel::StringValue::Replace(cel::StringValue const&, cel::StringValue const&, long, google::protobuf::Arena*, cel::Value*) const::$_1>&&) const
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::StringValue::CharAt(long) const::$_0, cel::StringValue::CharAt(long) const::$_1> >(absl::lts_20260107::Overload<cel::StringValue::CharAt(long) const::$_0, cel::StringValue::CharAt(long) const::$_1>&&) const
string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::(anonymous namespace)::StringDebugString<cel::StringValue>(cel::StringValue const&)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::(anonymous namespace)::StringDebugString<cel::StringValue>(cel::StringValue const&)::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::(anonymous namespace)::StringDebugString<cel::StringValue>(cel::StringValue const&)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::(anonymous namespace)::StringDebugString<cel::StringValue>(cel::StringValue const&)::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Line
Count
Source
331
2.30k
  decltype(auto) Visit(Visitor&& visitor) const {
332
2.30k
    switch (GetKind()) {
333
1.96k
      case ByteStringKind::kSmall:
334
1.96k
        return std::forward<Visitor>(visitor)(GetSmall());
335
338
      case ByteStringKind::kMedium:
336
338
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
2.30k
    }
340
2.30k
  }
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0>(cel::StringValue::ConvertToJson(google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Message*) const::$_0&&) const
string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0>(cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0&&) const
Line
Count
Source
331
538
  decltype(auto) Visit(Visitor&& visitor) const {
332
538
    switch (GetKind()) {
333
382
      case ByteStringKind::kSmall:
334
382
        return std::forward<Visitor>(visitor)(GetSmall());
335
156
      case ByteStringKind::kMedium:
336
156
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
538
    }
340
538
  }
string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<std::__1::basic_string_view<char, std::__1::char_traits<char> > >(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&) const::{lambda(auto:1 const&)#1}>(cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<std::__1::basic_string_view<char, std::__1::char_traits<char> > >(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&) const::{lambda(auto:1 const&)#1}&&) const
Line
Count
Source
331
538
  decltype(auto) Visit(Visitor&& visitor) const {
332
538
    switch (GetKind()) {
333
303
      case ByteStringKind::kSmall:
334
303
        return std::forward<Visitor>(visitor)(GetSmall());
335
235
      case ByteStringKind::kMedium:
336
235
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
538
    }
340
538
  }
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<absl::lts_20260107::Cord>(absl::lts_20260107::Cord const&) const::{lambda(auto:1 const&)#1}>(cel::StringValue::Equal(cel::Value const&, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, google::protobuf::Arena*, cel::Value*) const::$_0::operator()<absl::lts_20260107::Cord>(absl::lts_20260107::Cord const&) const::{lambda(auto:1 const&)#1}&&) const
string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::Size() const::$_0>(cel::StringValue::Size() const::$_0&&) const
Line
Count
Source
331
47
  decltype(auto) Visit(Visitor&& visitor) const {
332
47
    switch (GetKind()) {
333
12
      case ByteStringKind::kSmall:
334
12
        return std::forward<Visitor>(visitor)(GetSmall());
335
35
      case ByteStringKind::kMedium:
336
35
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
47
    }
340
47
  }
Unexecuted instantiation: string_value.cc:decltype(auto) cel::common_internal::ByteString::Visit<cel::StringValue::IsEmpty() const::$_0>(cel::StringValue::IsEmpty() const::$_0&&) const
Unexecuted instantiation: struct_value_builder.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(absl::lts_20260107::Cord const&)#1}> >(absl::lts_20260107::Overload<cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#1}, cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(absl::lts_20260107::Cord const&)#1}>&&) const
Unexecuted instantiation: struct_value_builder.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#2}, cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(absl::lts_20260107::Cord const&)#2}> >(absl::lts_20260107::Overload<cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(std::__1::basic_string_view<char, std::__1::char_traits<char> >)#2}, cel::common_internal::(anonymous namespace)::MessageValueBuilderImpl::SetSingularField(google::protobuf::FieldDescriptor const*, cel::Value)::{lambda(absl::lts_20260107::Cord const&)#2}>&&) const
byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::Equals(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Line
Count
Source
331
3.27k
  decltype(auto) Visit(Visitor&& visitor) const {
332
3.27k
    switch (GetKind()) {
333
2.38k
      case ByteStringKind::kSmall:
334
2.38k
        return std::forward<Visitor>(visitor)(GetSmall());
335
888
      case ByteStringKind::kMedium:
336
888
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
3.27k
    }
340
3.27k
  }
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::Equals(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Equals(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::Equals(absl::lts_20260107::Cord const&) const::$_1>&&) const
byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::Compare(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Line
Count
Source
331
775
  decltype(auto) Visit(Visitor&& visitor) const {
332
775
    switch (GetKind()) {
333
614
      case ByteStringKind::kSmall:
334
614
        return std::forward<Visitor>(visitor)(GetSmall());
335
161
      case ByteStringKind::kMedium:
336
161
        return std::forward<Visitor>(visitor)(GetMedium());
337
0
      case ByteStringKind::kLarge:
338
0
        return std::forward<Visitor>(visitor)(GetLarge());
339
775
    }
340
775
  }
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::Compare(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Compare(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::Compare(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::StartsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::StartsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::StartsWith(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::StartsWith(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::StartsWith(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::EndsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_0, cel::common_internal::ByteString::EndsWith(std::__1::basic_string_view<char, std::__1::char_traits<char> >) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::EndsWith(absl::lts_20260107::Cord const&) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::EndsWith(absl::lts_20260107::Cord const&) const::$_0, cel::common_internal::ByteString::EndsWith(absl::lts_20260107::Cord const&) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(std::__1::basic_string_view<char, std::__1::char_traits<char> >, unsigned long) const::$_0, cel::common_internal::ByteString::Find(std::__1::basic_string_view<char, std::__1::char_traits<char> >, unsigned long) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(std::__1::basic_string_view<char, std::__1::char_traits<char> >, unsigned long) const::$_0, cel::common_internal::ByteString::Find(std::__1::basic_string_view<char, std::__1::char_traits<char> >, unsigned long) const::$_1>&&) const
Unexecuted instantiation: byte_string.cc:decltype(auto) cel::common_internal::ByteString::Visit<absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(absl::lts_20260107::Cord const&, unsigned long) const::$_0, cel::common_internal::ByteString::Find(absl::lts_20260107::Cord const&, unsigned long) const::$_1> >(absl::lts_20260107::Overload<cel::common_internal::ByteString::Find(absl::lts_20260107::Cord const&, unsigned long) const::$_0, cel::common_internal::ByteString::Find(absl::lts_20260107::Cord const&, unsigned long) const::$_1>&&) const
341
342
0
  friend void swap(ByteString& lhs, ByteString& rhs) {
343
0
    if (&lhs != &rhs) {
344
0
      lhs.Swap(rhs);
345
0
    }
346
0
  }
347
348
  template <typename H>
349
1.54k
  friend H AbslHashValue(H state, const ByteString& byte_string) {
350
1.54k
    byte_string.HashValue(absl::HashState::Create(&state));
351
1.54k
    return state;
352
1.54k
  }
353
354
 private:
355
  friend class ByteStringView;
356
  friend struct ByteStringTestFriend;
357
  friend class cel::BytesValueInputStream;
358
  friend class cel::BytesValueOutputStream;
359
  friend class cel::StringValue;
360
  friend absl::string_view LegacyByteString(const ByteString& string,
361
                                            bool stable,
362
                                            google::protobuf::Arena* absl_nonnull arena);
363
  friend struct cel::ArenaTraits<ByteString>;
364
365
  struct ExternalStringTag {};
366
367
  static ByteString Borrowed(Borrower borrower,
368
                             absl::string_view string
369
                                 ABSL_ATTRIBUTE_LIFETIME_BOUND);
370
371
  static ByteString Borrowed(
372
      Borrower borrower, const absl::Cord& cord ABSL_ATTRIBUTE_LIFETIME_BOUND);
373
374
  ByteString(const ReferenceCount* absl_nonnull refcount,
375
             absl::string_view string);
376
377
  ByteString(ExternalStringTag, absl::string_view string);
378
379
322k
  constexpr ByteStringKind GetKind() const { return rep_.header.kind; }
380
381
26.7k
  absl::string_view GetSmall() const {
382
26.7k
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kSmall);
383
26.7k
    return GetSmall(rep_.small);
384
26.7k
  }
385
386
26.7k
  static absl::string_view GetSmall(const SmallByteStringRep& rep) {
387
26.7k
    return absl::string_view(rep.data, rep.size);
388
26.7k
  }
389
390
6.54k
  absl::string_view GetMedium() const {
391
6.54k
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kMedium);
392
6.54k
    return GetMedium(rep_.medium);
393
6.54k
  }
394
395
6.54k
  static absl::string_view GetMedium(const MediumByteStringRep& rep) {
396
6.54k
    return absl::string_view(rep.data, rep.size);
397
6.54k
  }
398
399
0
  google::protobuf::Arena* absl_nullable GetSmallArena() const {
400
0
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kSmall);
401
0
    return GetSmallArena(rep_.small);
402
0
  }
403
404
  static google::protobuf::Arena* absl_nullable GetSmallArena(
405
0
      const SmallByteStringRep& rep) {
406
0
    return rep.arena;
407
0
  }
408
409
284
  google::protobuf::Arena* absl_nullable GetMediumArena() const {
410
284
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kMedium);
411
284
    return GetMediumArena(rep_.medium);
412
284
  }
413
414
  static google::protobuf::Arena* absl_nullable GetMediumArena(
415
      const MediumByteStringRep& rep);
416
417
21.3k
  const ReferenceCount* absl_nullable GetMediumReferenceCount() const {
418
21.3k
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kMedium);
419
21.3k
    return GetMediumReferenceCount(rep_.medium);
420
21.3k
  }
421
422
  static const ReferenceCount* absl_nullable GetMediumReferenceCount(
423
      const MediumByteStringRep& rep);
424
425
0
  uintptr_t GetMediumOwner() const {
426
0
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kMedium);
427
0
    return rep_.medium.owner;
428
0
  }
429
430
0
  absl::Cord& GetLarge() ABSL_ATTRIBUTE_LIFETIME_BOUND {
431
0
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kLarge);
432
0
    return GetLarge(rep_.large);
433
0
  }
434
435
  static absl::Cord& GetLarge(
436
0
      LargeByteStringRep& rep ABSL_ATTRIBUTE_LIFETIME_BOUND) {
437
0
    return *std::launder(reinterpret_cast<absl::Cord*>(&rep.data[0]));
438
0
  }
439
440
0
  const absl::Cord& GetLarge() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
441
0
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kLarge);
442
0
    return GetLarge(rep_.large);
443
0
  }
444
445
  static const absl::Cord& GetLarge(
446
0
      const LargeByteStringRep& rep ABSL_ATTRIBUTE_LIFETIME_BOUND) {
447
0
    return *std::launder(reinterpret_cast<const absl::Cord*>(&rep.data[0]));
448
0
  }
449
450
1.35k
  void SetSmallEmpty(google::protobuf::Arena* absl_nullable arena) {
451
1.35k
    rep_.header.kind = ByteStringKind::kSmall;
452
1.35k
    rep_.small.size = 0;
453
1.35k
    rep_.small.arena = arena;
454
1.35k
  }
455
456
  void SetSmall(google::protobuf::Arena* absl_nullable arena, absl::string_view string);
457
458
  void SetSmall(google::protobuf::Arena* absl_nullable arena, const absl::Cord& cord);
459
460
  void SetMedium(google::protobuf::Arena* absl_nullable arena, absl::string_view string);
461
462
  // This is used to create a medium byte string that is backed by an external
463
  // string. Should only be called from explicit 'Unsafe' factories.
464
  void SetExternalMedium(absl::string_view string);
465
466
  void SetMedium(google::protobuf::Arena* absl_nullable arena, std::string&& string);
467
468
  void SetMedium(google::protobuf::Arena* absl_nonnull arena, const absl::Cord& cord);
469
470
  void SetMedium(absl::string_view string, uintptr_t owner);
471
472
  void SetLarge(const absl::Cord& cord);
473
474
  void SetLarge(absl::Cord&& cord);
475
476
  void Swap(ByteString& other);
477
478
  void Construct(const ByteString& other,
479
                 absl::optional<Allocator<>> allocator);
480
481
  void Construct(ByteString& other, absl::optional<Allocator<>> allocator);
482
483
  void CopyFrom(const ByteString& other);
484
485
  void MoveFrom(ByteString& other);
486
487
  void Destroy();
488
489
76.4k
  void DestroyMedium() {
490
76.4k
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kMedium);
491
76.4k
    DestroyMedium(rep_.medium);
492
76.4k
  }
493
494
76.4k
  static void DestroyMedium(const MediumByteStringRep& rep) {
495
76.4k
    StrongUnref(GetMediumReferenceCount(rep));
496
76.4k
  }
497
498
0
  void DestroyLarge() {
499
0
    ABSL_DCHECK_EQ(GetKind(), ByteStringKind::kLarge);
500
0
    DestroyLarge(rep_.large);
501
0
  }
502
503
0
  static void DestroyLarge(LargeByteStringRep& rep) { GetLarge(rep).~Cord(); }
504
505
  void CopyToArray(char* absl_nonnull out) const;
506
507
  ByteStringRep rep_;
508
};
509
510
155
inline bool ByteString::Equals(const ByteString& rhs) const {
511
155
  return rhs.Visit(absl::Overload(
512
155
      [this](absl::string_view rhs) -> bool { return Equals(rhs); },
513
155
      [this](const absl::Cord& rhs) -> bool { return Equals(rhs); }));
514
155
}
515
516
775
inline int ByteString::Compare(const ByteString& rhs) const {
517
775
  return rhs.Visit(absl::Overload(
518
775
      [this](absl::string_view rhs) -> int { return Compare(rhs); },
519
775
      [this](const absl::Cord& rhs) -> int { return Compare(rhs); }));
520
775
}
521
522
0
inline bool ByteString::StartsWith(const ByteString& rhs) const {
523
0
  return rhs.Visit(absl::Overload(
524
0
      [this](absl::string_view rhs) -> bool { return StartsWith(rhs); },
525
0
      [this](const absl::Cord& rhs) -> bool { return StartsWith(rhs); }));
526
0
}
527
528
0
inline bool ByteString::EndsWith(const ByteString& rhs) const {
529
0
  return rhs.Visit(absl::Overload(
530
0
      [this](absl::string_view rhs) -> bool { return EndsWith(rhs); },
531
0
      [this](const absl::Cord& rhs) -> bool { return EndsWith(rhs); }));
532
0
}
533
534
inline absl::optional<size_t> ByteString::Find(const ByteString& needle,
535
0
                                               size_t pos) const {
536
0
  return needle.Visit(absl::Overload(
537
0
      [this, pos](absl::string_view rhs) -> absl::optional<size_t> {
538
0
        return Find(rhs, pos);
539
0
      },
540
0
      [this, pos](const absl::Cord& rhs) -> absl::optional<size_t> {
541
0
        return Find(rhs, pos);
542
0
      }));
543
0
}
544
545
42
inline bool operator==(const ByteString& lhs, const ByteString& rhs) {
546
42
  return lhs.Equals(rhs);
547
42
}
548
549
0
inline bool operator==(const ByteString& lhs, absl::string_view rhs) {
550
0
  return lhs.Equals(rhs);
551
0
}
552
553
0
inline bool operator==(absl::string_view lhs, const ByteString& rhs) {
554
0
  return rhs.Equals(lhs);
555
0
}
556
557
0
inline bool operator==(const ByteString& lhs, const absl::Cord& rhs) {
558
0
  return lhs.Equals(rhs);
559
0
}
560
561
0
inline bool operator==(const absl::Cord& lhs, const ByteString& rhs) {
562
0
  return rhs.Equals(lhs);
563
0
}
564
565
0
inline bool operator!=(const ByteString& lhs, const ByteString& rhs) {
566
0
  return !operator==(lhs, rhs);
567
0
}
568
569
0
inline bool operator!=(const ByteString& lhs, absl::string_view rhs) {
570
0
  return !operator==(lhs, rhs);
571
0
}
572
573
0
inline bool operator!=(absl::string_view lhs, const ByteString& rhs) {
574
0
  return !operator==(lhs, rhs);
575
0
}
576
577
0
inline bool operator!=(const ByteString& lhs, const absl::Cord& rhs) {
578
0
  return !operator==(lhs, rhs);
579
0
}
580
581
0
inline bool operator!=(const absl::Cord& lhs, const ByteString& rhs) {
582
0
  return !operator==(lhs, rhs);
583
0
}
584
585
0
inline bool operator<(const ByteString& lhs, const ByteString& rhs) {
586
0
  return lhs.Compare(rhs) < 0;
587
0
}
588
589
0
inline bool operator<(const ByteString& lhs, absl::string_view rhs) {
590
0
  return lhs.Compare(rhs) < 0;
591
0
}
592
593
0
inline bool operator<(absl::string_view lhs, const ByteString& rhs) {
594
0
  return -rhs.Compare(lhs) < 0;
595
0
}
596
597
0
inline bool operator<(const ByteString& lhs, const absl::Cord& rhs) {
598
0
  return lhs.Compare(rhs) < 0;
599
0
}
600
601
0
inline bool operator<(const absl::Cord& lhs, const ByteString& rhs) {
602
0
  return -rhs.Compare(lhs) < 0;
603
0
}
604
605
0
inline bool operator<=(const ByteString& lhs, const ByteString& rhs) {
606
0
  return lhs.Compare(rhs) <= 0;
607
0
}
608
609
0
inline bool operator<=(const ByteString& lhs, absl::string_view rhs) {
610
0
  return lhs.Compare(rhs) <= 0;
611
0
}
612
613
0
inline bool operator<=(absl::string_view lhs, const ByteString& rhs) {
614
0
  return -rhs.Compare(lhs) <= 0;
615
0
}
616
617
0
inline bool operator<=(const ByteString& lhs, const absl::Cord& rhs) {
618
0
  return lhs.Compare(rhs) <= 0;
619
0
}
620
621
0
inline bool operator<=(const absl::Cord& lhs, const ByteString& rhs) {
622
0
  return -rhs.Compare(lhs) <= 0;
623
0
}
624
625
0
inline bool operator>(const ByteString& lhs, const ByteString& rhs) {
626
0
  return lhs.Compare(rhs) > 0;
627
0
}
628
629
0
inline bool operator>(const ByteString& lhs, absl::string_view rhs) {
630
0
  return lhs.Compare(rhs) > 0;
631
0
}
632
633
0
inline bool operator>(absl::string_view lhs, const ByteString& rhs) {
634
0
  return -rhs.Compare(lhs) > 0;
635
0
}
636
637
0
inline bool operator>(const ByteString& lhs, const absl::Cord& rhs) {
638
0
  return lhs.Compare(rhs) > 0;
639
0
}
640
641
0
inline bool operator>(const absl::Cord& lhs, const ByteString& rhs) {
642
0
  return -rhs.Compare(lhs) > 0;
643
0
}
644
645
0
inline bool operator>=(const ByteString& lhs, const ByteString& rhs) {
646
0
  return lhs.Compare(rhs) >= 0;
647
0
}
648
649
0
inline bool operator>=(const ByteString& lhs, absl::string_view rhs) {
650
0
  return lhs.Compare(rhs) >= 0;
651
0
}
652
653
0
inline bool operator>=(absl::string_view lhs, const ByteString& rhs) {
654
0
  return -rhs.Compare(lhs) >= 0;
655
0
}
656
657
0
inline bool operator>=(const ByteString& lhs, const absl::Cord& rhs) {
658
0
  return lhs.Compare(rhs) >= 0;
659
0
}
660
661
0
inline bool operator>=(const absl::Cord& lhs, const ByteString& rhs) {
662
0
  return -rhs.Compare(lhs) >= 0;
663
0
}
664
665
#undef CEL_COMMON_INTERNAL_BYTE_STRING_TRIVIAL_ABI
666
667
}  // namespace common_internal
668
669
template <>
670
struct ArenaTraits<common_internal::ByteString> {
671
  using constructible = std::true_type;
672
673
  static bool trivially_destructible(
674
22.7k
      const common_internal::ByteString& byte_string) {
675
22.7k
    switch (byte_string.GetKind()) {
676
13.6k
      case common_internal::ByteStringKind::kSmall:
677
13.6k
        return true;
678
9.13k
      case common_internal::ByteStringKind::kMedium:
679
9.13k
        return byte_string.GetMediumReferenceCount() == nullptr;
680
0
      case common_internal::ByteStringKind::kLarge:
681
0
        return false;
682
22.7k
    }
683
22.7k
  }
684
};
685
686
}  // namespace cel
687
688
#endif  // THIRD_PARTY_CEL_CPP_COMMON_INTERNAL_BYTE_STRING_H_