chromium/sql/sqlite_result_code.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "sql/sqlite_result_code.h"

#include <cstddef>
#include <ostream>  // Needed to compile CHECK() with operator <<.
#include <ranges>
#include <set>
#include <string>
#include <string_view>

#include "base/check.h"
#include "base/check_op.h"
#include "base/dcheck_is_on.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "sql/sqlite_result_code_values.h"
#include "third_party/sqlite/sqlite3.h"

namespace sql {

namespace {

// The highly packed representation minimizes binary size and memory usage.
struct SqliteResultCodeMappingEntry {};

constexpr SqliteResultCodeMappingEntry kResultCodeMapping[] =;

// Looks up a `sqlite_result_code` in the mapping tables.
//
// Returns an entry in kResultCodeMapping or kUnknownResultCodeMappingEntry.
// CHECKs if the `sqlite_result_code` is not in the mapping table.
SqliteResultCodeMappingEntry FindResultCode(int sqlite_result_code) {}

}  // namespace

#if DCHECK_IS_ON()

SqliteResultCode ToSqliteResultCode(int sqlite_result_code) {}

SqliteErrorCode ToSqliteErrorCode(SqliteResultCode sqlite_error_code) {}

#endif  // DCHECK_IS_ON()

bool IsSqliteSuccessCode(SqliteResultCode sqlite_result_code) {}

SqliteLoggedResultCode ToSqliteLoggedResultCode(int sqlite_result_code) {}

void UmaHistogramSqliteResult(const std::string& histogram_name,
                              int sqlite_result_code) {}

std::ostream& operator<<(std::ostream& os,
                         SqliteResultCode sqlite_result_code) {}

std::ostream& operator<<(std::ostream& os, SqliteErrorCode sqlite_error_code) {}

void CheckSqliteLoggedResultCodeForTesting() {}

}  // namespace sql