Go to the documentation of this file.
77 if (s.refcount ==
nullptr ||
81 return s.data.refcounted.length;
162 void (*
destroy)(
void*,
size_t)) {
198 const size_t len = strlen(
p.get());
210 reinterpret_cast<uint8_t*
>(
const_cast<char*
>(
str.data()));
399 a_len =
a.data.refcounted.length;
400 a_ptr =
a.data.refcounted.bytes;
402 a_len =
a.data.inlined.length;
403 a_ptr = &
a.data.inlined.bytes[0];
413 if (a_ptr ==
nullptr) {
421 if (
d != 0)
return d;
427 size_t b_length = strlen(
b);
429 if (
d != 0)
return d;
434 if (
a.refcount ==
nullptr ||
b.refcount ==
nullptr) {
437 return a.data.refcounted.length ==
b.data.refcounted.length &&
438 a.data.refcounted.bytes ==
b.data.refcounted.bytes;
458 return p ==
nullptr ? -1 :
static_cast<int>(
p -
b);
467 if (haystack_len == 0 || needle_len == 0)
return -1;
468 if (haystack_len < needle_len)
return -1;
469 if (haystack_len == needle_len) {
472 if (needle_len == 1) {
473 return grpc_slice_chr(haystack,
static_cast<char>(*needle_bytes));
476 const uint8_t* last = haystack_bytes + haystack_len - needle_len;
478 if (0 == memcmp(
cur, needle_bytes, needle_len)) {
479 return static_cast<int>(
cur - haystack_bytes);
grpc_slice grpc_slice_copy(grpc_slice s)
int grpc_slice_buf_start_eq(grpc_slice a, const void *b, size_t len)
grpc_slice grpc_slice_from_static_string(const char *s)
int grpc_slice_is_equivalent(grpc_slice a, grpc_slice b)
struct grpc_slice_refcount * refcount
static void Destroy(grpc_slice_refcount *arg)
grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr< char > p)
void(* user_destroy_)(void *, size_t)
static void Destroy(grpc_slice_refcount *arg)
static void Destroy(grpc_slice_refcount *arg)
grpc_slice grpc_slice_new(void *p, size_t len, void(*destroy)(void *))
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
static StaticSlice FromStaticString(const char *s)
int grpc_slice_rchr(grpc_slice s, char c)
int grpc_slice_eq(grpc_slice a, grpc_slice b)
#define GRPC_SLICE_MALLOC(len)
int grpc_slice_differs_refcounted(const grpc_slice &a, const grpc_slice &b_not_inline)
GPRAPI void * gpr_malloc(size_t size)
grpc_slice grpc_empty_slice(void)
int grpc_slice_slice(grpc_slice haystack, grpc_slice needle)
NewWithLenSliceRefcount(void(*destroy)(void *, size_t), void *user_data, size_t user_length)
static grpc_slice_refcount * NoopRefcount()
NewSliceRefcount(void(*destroy)(void *), void *user_data)
grpc_slice grpc_slice_new_with_user_data(void *p, size_t len, void(*destroy)(void *), void *user_data)
grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
int grpc_slice_str_cmp(grpc_slice a, const char *b)
int grpc_slice_cmp(grpc_slice a, grpc_slice b)
char * grpc_slice_to_c_string(grpc_slice slice)
static constexpr grpc_slice EmptySlice()
void(* user_destroy_)(void *)
struct grpc_slice::grpc_slice_data::grpc_slice_inlined inlined
size_t grpc_slice_memory_usage(grpc_slice s)
grpc_slice grpc_slice_split_tail(grpc_slice *source, size_t split)
grpc_slice grpc_slice_malloc_large(size_t length)
#define GRPC_SLICE_START_PTR(slice)
grpc_slice grpc_slice_malloc(size_t length)
grpc_slice grpc_slice_from_static_buffer(const void *s, size_t len)
grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end)
std::unique_ptr< T, DefaultDeleteChar > UniquePtr
grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice *source, size_t split, grpc_slice_ref_whom ref_whom)
#define GRPC_SLICE_LENGTH(slice)
grpc_slice grpc_slice_new_with_len(void *p, size_t len, void(*destroy)(void *, size_t))
struct grpc_slice::grpc_slice_data::grpc_slice_refcounted refcounted
static StaticSlice FromStaticBuffer(const void *s, size_t len)
union grpc_slice::grpc_slice_data data
#define GRPC_SLICE_INLINED_SIZE
grpc_slice grpc_slice_from_cpp_string(std::string str)
int grpc_slice_chr(grpc_slice s, char c)
uint8_t bytes[GRPC_SLICE_INLINED_SIZE]
static void Destroy(grpc_slice_refcount *arg)
MovedCppStringSliceRefCount(std::string &&str)
~NewWithLenSliceRefcount()
grpc_slice grpc_slice_dup(grpc_slice a)
static void split(const char *s, char ***ss, size_t *ns)
static grpc_slice sub_no_ref(const grpc_slice &source, size_t begin, size_t end)
grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr< char > p, size_t len)
grpc_slice grpc_slice_split_head(grpc_slice *source, size_t split)
static std::function< void(void *, Slot *)> destroy
grpc_slice grpc_slice_from_copied_string(const char *source)
MovedStringSliceRefCount(UniquePtr< char > &&str)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:13