chromium/third_party/grpc/src/src/core/lib/gprpp/status_helper.cc

//
//
// Copyright 2021 the gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#include <grpc/support/port_platform.h>

#include "src/core/lib/gprpp/status_helper.h"

#include <string.h>

#include <algorithm>
#include <utility>

#include "absl/strings/cord.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/time/clock.h"
#include "google/protobuf/any.upb.h"
#include "google/rpc/status.upb.h"
#include "upb/arena.h"
#include "upb/upb.h"
#include "upb/upb.hpp"

#include <grpc/support/log.h>

#include "src/core/lib/slice/percent_encoding.h"
#include "src/core/lib/slice/slice.h"

namespace grpc_core {

namespace {

#define TYPE_URL_PREFIX
#define TYPE_INT_TAG
#define TYPE_STR_TAG
#define TYPE_TIME_TAG
#define TYPE_CHILDREN_TAG
#define TYPE_URL(name)
const absl::string_view kTypeUrlPrefix =;
const absl::string_view kTypeIntTag =;
const absl::string_view kTypeStrTag =;
const absl::string_view kTypeTimeTag =;
const absl::string_view kTypeChildrenTag =;
const absl::string_view kChildrenPropertyUrl =;

const char* GetStatusIntPropertyUrl(StatusIntProperty key) {}

const char* GetStatusStrPropertyUrl(StatusStrProperty key) {}

const char* GetStatusTimePropertyUrl(StatusTimeProperty key) {}

void EncodeUInt32ToBytes(uint32_t v, char* buf) {}

uint32_t DecodeUInt32FromBytes(const char* buf) {}

std::vector<absl::Status> ParseChildren(absl::Cord children) {}

}  // namespace

absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg,
                          const DebugLocation& location,
                          std::vector<absl::Status> children) {}

void StatusSetInt(absl::Status* status, StatusIntProperty key, intptr_t value) {}

absl::optional<intptr_t> StatusGetInt(const absl::Status& status,
                                      StatusIntProperty key) {}

void StatusSetStr(absl::Status* status, StatusStrProperty key,
                  absl::string_view value) {}

absl::optional<std::string> StatusGetStr(const absl::Status& status,
                                         StatusStrProperty key) {}

void StatusSetTime(absl::Status* status, StatusTimeProperty key,
                   absl::Time time) {}

absl::optional<absl::Time> StatusGetTime(const absl::Status& status,
                                         StatusTimeProperty key) {}

void StatusAddChild(absl::Status* status, absl::Status child) {}

std::vector<absl::Status> StatusGetChildren(absl::Status status) {}

std::string StatusToString(const absl::Status& status) {}

namespace internal {

google_rpc_Status* StatusToProto(const absl::Status& status, upb_Arena* arena) {}

absl::Status StatusFromProto(google_rpc_Status* msg) {}

uintptr_t StatusAllocHeapPtr(absl::Status s) {}

void StatusFreeHeapPtr(uintptr_t ptr) {}

absl::Status StatusGetFromHeapPtr(uintptr_t ptr) {}

absl::Status StatusMoveFromHeapPtr(uintptr_t ptr) {}

}  // namespace internal

}  // namespace grpc_core