Files
scylla/sstables/component_type.hh
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

71 lines
1.9 KiB
C++

/*
* Copyright (C) 2018-present ScyllaDB
*
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include <fmt/format.h>
namespace sstables {
enum class component_type {
Index,
CompressionInfo,
Data,
TOC,
Summary,
Digest,
CRC,
Filter,
Statistics,
TemporaryTOC,
TemporaryStatistics,
Scylla,
Unknown,
};
}
using component_type = ::sstables::component_type;
template <>
struct fmt::formatter<sstables::component_type> : fmt::formatter<string_view> {
template <typename FormatContext>
auto format(const sstables::component_type& comp_type, FormatContext& ctx) const {
using enum sstables::component_type;
switch (comp_type) {
case Index:
return formatter<string_view>::format("Index", ctx);
case CompressionInfo:
return formatter<string_view>::format("CompressionInfo", ctx);
case Data:
return formatter<string_view>::format("Data", ctx);
case TOC:
return formatter<string_view>::format("TOC", ctx);
case Summary:
return formatter<string_view>::format("Summary", ctx);
case Digest:
return formatter<string_view>::format("Digest", ctx);
case CRC:
return formatter<string_view>::format("CRC", ctx);
case Filter:
return formatter<string_view>::format("Filter", ctx);
case Statistics:
return formatter<string_view>::format("Statistics", ctx);
case TemporaryTOC:
return formatter<string_view>::format("TemporaryTOC", ctx);
case TemporaryStatistics:
return formatter<string_view>::format("TemporaryStatistics", ctx);
case Scylla:
return formatter<string_view>::format("Scylla", ctx);
case Unknown:
return formatter<string_view>::format("Unknown", ctx);
}
}
};