chromium/third_party/fuzztest/src/fuzztest/internal/printer.h

// Copyright 2022 Google LLC
//
// 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.

// IWYU pragma: private, include "fuzztest/fuzztest.h"
// IWYU pragma: friend fuzztest/.*

#ifndef FUZZTEST_FUZZTEST_INTERNAL_PRINTER_H_
#define FUZZTEST_FUZZTEST_INTERNAL_PRINTER_H_

#include "absl/strings/str_format.h"
#include "./fuzztest/internal/meta.h"

namespace fuzztest::domain_implementor {

// The type used for sink objects passed to PrintCorpusValue and PrintUserValue
// formatting functions of domain printers.
RawSink;

// The mode that determines how a domain printer's formatting function should
// format the value.
enum class PrintMode {};

// Invokes PrintCorpusValue or PrintUserValue from the domain's type printer,
// depending on what's available. It will automatically call GetValue if needed
// for the PrintUserValue call.
template <typename Domain>
void PrintValue(const Domain& domain,
                const internal::corpus_type_t<Domain>& corpus_value,
                RawSink out, PrintMode mode) {}

}  // namespace fuzztest::domain_implementor

#endif  // FUZZTEST_FUZZTEST_INTERNAL_PRINTER_H_