folly/folly/lang/Pretty.h

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * 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.
 */

#pragma once

#include <cstddef>
#include <type_traits>

#include <folly/Portability.h>
#include <folly/lang/CArray.h>

namespace folly {

namespace detail {

pretty_carray;

static constexpr char* pretty_carray_copy(
    char* dest, const char* src, std::size_t n) {}

template <std::size_t S>
static constexpr pretty_carray<S> pretty_carray_from(char const (&in)[S]) {}

struct pretty_info {};

template <typename To, std::size_t S>
static constexpr To pretty_info_to(pretty_info info, char const (&name)[S]) {}

template <std::size_t S>
static constexpr std::size_t pretty_lfind(
    char const (&haystack)[S], char const needle) {}

template <std::size_t S>
static constexpr std::size_t pretty_rfind(
    char const (&haystack)[S], char const needle) {}

struct pretty_tag_msc {};
struct pretty_tag_gcc {};

pretty_default_tag;

template <typename T>
static constexpr auto pretty_raw(pretty_tag_msc) {}

template <typename T>
static constexpr auto pretty_raw(pretty_tag_gcc) {}

template <std::size_t S>
static constexpr pretty_info pretty_parse(
    pretty_tag_msc, char const (&name)[S]) {}

template <std::size_t S>
static constexpr pretty_info pretty_parse(
    pretty_tag_gcc, char const (&name)[S]) {}

template <typename T, typename Tag>
struct pretty_name_zarray {};

template <typename T>
constexpr const auto& pretty_name_carray() {}

} // namespace detail

//  pretty_name
//
//  Returns a statically-allocated C string containing the pretty name of T.
//
//  The pretty name of a type varies by compiler, may include tokens which
//  would not be present in the type name as it is spelled in the source code
//  or as it would be symbolized, and may not include tokens which would be
//  present in the type name as it would be symbolized.
template <typename T>
constexpr char const* pretty_name() {}

} // namespace folly